Skip to content

Conversation

@cory-miller
Copy link
Contributor

@cory-miller cory-miller commented Apr 25, 2024

This is carried over from #1184. Below is the original PR body. This PR updates the base for actions/checkout@v4


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: SocketDev/socket-sdk-js@24f0574

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: SocketDev/socket-sdk-js@b0948d0

@cory-miller cory-miller changed the title Users/cory miller/git user and email README: Suggest user.email to be 41898282+github-actions[bot]@users.noreply.github.com Apr 25, 2024
@cory-miller cory-miller marked this pull request as ready for review April 25, 2024 20:10
@cory-miller cory-miller requested a review from a team as a code owner April 25, 2024 20:10
@cory-miller cory-miller merged commit 44c2b7a into main Apr 30, 2024
@cory-miller cory-miller deleted the users/cory-miller/git-user-and-email branch April 30, 2024 15:50
@szepeviktor
Copy link

szepeviktor commented May 7, 2024

This user ID can be obtained from GitHub's API.
https://api.github.com/users/github-actions%5Bbot%5D