GitHub Actions bot email address?

I wanted to commit to the repository from within a workflow. Simply running:

git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m "Add URL" -a

works, but GitHub action’s icon doesn’t show up. 

P4Q49mr

I couldn’t find the correct email address for the bot anywhere. Any help would be appreciated!

[nvm, readed words wrong]

This is an expected behavior. In commits author field, it will not show the black github-actions bot icon, just a gray one. It shows the name you specify in git config user.name.

Github Actions bot is just a bot account when you do operations with GITHUB_TOKEN. In pull requests, issues page, you can see its icon, but not in commits. Sorry for any inconvenience.  

2 Likes

Would it be easy for GitHub to just assign an email address to the bot account so that commits with that email address would show the bot’s avatar?

1 Like

I believe I was able to determine a valid email address to use by copying the format they use for dependabot:

https://api.github.com/users/dependabot-preview[bot]/events/public

All of the commits are from 

27856297+dependabot-preview[bot]@users.noreply.github.com

…where 27856297 is the user ID for dependabot[bot].

So I tried:

git commit --allow-empty --author="github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"

and it seemed to work:

7 Likes

The email address suggested by @ericnorris actually works:

41898282+github-actions[bot]@users.noreply.github.com

Using this for git config user.email results in:

Screenshot 2020-07-23 at 14.36.08

https://api.github.com/users/github-actions[bot] seems to be the API entry for the github-actions bot, which also contains the ID 41898282.

5 Likes

Yep! This is amazing. @weibeld +rep to you my dude.

Just go to https://api.github.com/users/better-informatics[bot] and use the ID from there :slight_smile: