README: Suggest `user.email` to be `41898282+github-actions[bot]@users.noreply.github.com`
To get a proper GitHub Actions Bot annotation to a commit one should set the user.name and user.email to:
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
There are some confusion around this in the actions/ org itself:
-
actions/toolkit/.github/workflows/update-github.yam uses
github-actions[bot]+[email protected]which does not give a proper avatar on the commit -
actions/deploy-pages/.github/workflows/rebuild-dependabot-prs.yml uses the setup suggested in this PR (
github-actions[bot]+github-actions[bot]@users.noreply.github.com) apart from lacking the41898282+prefix to the email -
actions/runner-images/.github/workflows/merge_pull_request.yml uses
Actions service account+[email protected] - actions/actions-runner-controller/.github/workflows/update-runners.yaml uses uses the exact same setup as suggested here, referencing this discussion as the source of why that is correct
(Another interesting aspect of the linked to workflows is that some use --local when setting the name and email, some use --global and some does what is suggested here and use neither of --local and --global)
Of note is also a third approach from the community, where it strives to achieve custom bot users (+ to get around the limitation of workflow created PR:s not running workflows): https://github.com/wow-actions/use-app-token Such a env.BOT_NAME would be quite nice to have built in to use.
An example generated with this setup can be found here: https://github.com/SocketDev/socket-sdk-js/pull/72/commits/24f05748ebcb527cf35dfa5c4cbc2b66d69a45f3
Generated with: https://github.com/SocketDev/workflows/blob/24190c5ca3aa54b086ff1666ed4486f6bc1e9ec9/.github/workflows/reusable-sync.yml#L118-L119
EDIT: Swapped the recommendation to include the prefix 41898282+ as I found out that that's the email used when the bot does eg. squash commits and thus its otherwise showing up as being two different users, which looks a bit confusing. See eg: https://github.com/SocketDev/socket-sdk-js/commit/b0948d0da0cfb5b240c69d063cc34a6399abce48
@voxpelli : just want to thank you for opening this PR as I myself had the same question. I'm working to raise this up with the Actions team as I think it should be considered and merged 👍
Anything I can do to move this forward @cory-miller and others?
Hey @voxpelli I've updated your branch with the actions/checkout@v4 changes. I was not able to run the CI against this since the fork was behind. I've opened a PR in https://github.com/actions/checkout/pull/1707 and will get someone else to approve it.