Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default user.name and user.email #584

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

jablko
Copy link

@jablko jablko commented Sep 15, 2021

This PR sets up a default user.name and user.email for scripting git commit. Users can continue to configure their own values as now, this PR just affords the option not to.

Shouldn't affect existing users: If users git config --global user.{name,email} before actions/checkout, this will respect existing values. If they git config --global after actions/checkout they'll overwrite these defaults. If they git config --local (before or after), those values take precedence.

Fixes #13, although the issue proposed defaulting to the author/user from the event that triggered the action.

Also discussed in #158, although the PR doesn't propose defaults.

Configuring user.{name,email}/scripting git commit is documented in the README.md. The relevant text of ADR 0153 reads:

Note:

  • Users scripting git commit may need to set the username and email. The service does not provide any reasonable default value. Users can add git config user.name <NAME> and git config user.email <EMAIL>. We will document this guidance.

Default user.name

I used $GITHUB_WORKFLOW for the default user.name because it's the most helpful value to have in there? Other proposals include the current README.md value ("github-actions") and the author/user from the event that triggered the action.

Here's how $GITHUB_WORKFLOW looks in GitHub's UI -- however I'm equally happy if a different default is implemented: Screenshot from 2021-09-10 10-55-25

Default user.email

I went with the current README.md value ("github-actions@github.com"), however @JojOatXGME lays out the options.

@wheelerlaw
Copy link

+1 for using github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> as the name and email. That will make it so it shows up nicely in the GitHub UI.

Co-authored-by: Usman <akeju00+github@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set git user and email
3 participants