Skip to content

Conversation

Copy link

Copilot AI commented Sep 16, 2025

This PR refactors the hardcoded Git user credentials to configurable inputs, allowing users to customize the git user email and name used for commits while maintaining backward compatibility.

Problem

The workflow currently hardcodes the Git user email as "[email protected]" and the user name as "cloudpossebot" in action.yml. This prevents users from customizing the commit author information to match their organization's requirements or preferences.

Solution

Added two new optional inputs to the GitHub Action:

  • git-user-email: Git user email for commits (default: "[email protected]")
  • git-user-name: Git user name for commits (default: "cloudpossebot")

The git configuration commands now use these input variables instead of hardcoded strings:

git config --global user.email "${{ inputs.git-user-email }}"
git config --global user.name "${{ inputs.git-user-name }}"

Usage

Default behavior (backward compatible):

- uses: cloudposse/github-action-deploy-argocd@main
  with:
    cluster: https://github.com/example/argocd-config
    # ... other required inputs
    # git-user-email and git-user-name will use defaults

Custom git user:

- uses: cloudposse/github-action-deploy-argocd@main
  with:
    cluster: https://github.com/example/argocd-config
    # ... other required inputs
    git-user-email: "[email protected]"
    git-user-name: "company-deployment-bot"

Changes

  • action.yml: Added two new optional inputs with sensible defaults matching the previous hardcoded values
  • action.yml: Updated git config commands to use input variables instead of hardcoded strings
  • README.md: Updated inputs documentation table to include the new parameters

Backward Compatibility

Existing workflows will continue to work unchanged, as the new inputs are optional and default to the original hardcoded values. No breaking changes are introduced.

This pull request was created as a result of the following prompt from Copilot chat.

The workflow currently hardcodes the Git user email as "[email protected]" and the user name as "cloudpossebot" in action.yml. Refactor the workflow so that both values are configurable inputs to the GitHub Action, with sensible defaults matching the current hardcoded values. Update the documentation in action.yml to reflect these new inputs, and ensure the workflow uses the provided values instead of hardcoded strings.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@milldr milldr added the minor New features that do not break anything label Sep 16, 2025
Copilot AI changed the title [WIP] Make git user.email and user.name configurable inputs feat: Add configurable git user inputs for commit customization Sep 16, 2025
Copilot AI requested a review from milldr September 16, 2025 19:30
@milldr milldr marked this pull request as ready for review September 16, 2025 19:31
@milldr
Copy link
Member

milldr commented Sep 26, 2025

Tests are failing unrelated to this change. Needs additional work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor New features that do not break anything

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants