checkout icon indicating copy to clipboard operation
checkout copied to clipboard

README: Suggest `user.email` to be `41898282+github-actions[bot]@users.noreply.github.com`

Open voxpelli opened this issue 2 years ago • 2 comments

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:

(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 avatar Feb 22 '23 12:02 voxpelli

@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 👍

andyfeller avatar Sep 18 '23 13:09 andyfeller

Anything I can do to move this forward @cory-miller and others?

voxpelli avatar Feb 05 '24 12:02 voxpelli

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.

cory-miller avatar Apr 25 '24 20:04 cory-miller