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

Incorrect/incomplete committer/author defaults #27

Open
webknjaz opened this issue Dec 1, 2022 · 3 comments
Open

Incorrect/incomplete committer/author defaults #27

webknjaz opened this issue Dec 1, 2022 · 3 comments

Comments

@webknjaz
Copy link

webknjaz commented Dec 1, 2022

The proper author/committer for the GHA bot is github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>. This will make GitHub show GHA as the commit author. Follow the example of
https://github.com/fregante/setup-git-user/blob/2e28d51/index.js#L5-L6.

The same goes for the regular users — they need emails in form of {user_id}+{whatever}@users.noreply.github.com. This is the current format of the "private" addresses. It exists so that when the users change usernames, the commits are still assigned properly, unlike with the old email format which didn't take this into account and didn't have an id.

The ID can be found at https://api.github.com/users/github-actions[bot]. GitHub Apps have that [bot] suffix, and regular users don't. GitHub Actions is implemented as a GitHub app, hence the [bot] marker. But you can follow the same lookup principle when generating user email defaults.

Ref: https://hynek.me/til/easier-crediting-contributors-github/

@carloscastrojumo
Copy link
Owner

Hi @webknjaz . This is very interesting, didn't know about that. I'm happy to work on that or if you prefer, you can contribute with a PR! : )

@webknjaz
Copy link
Author

webknjaz commented Dec 3, 2022

Nah, I wasn't planning to use this action. I just saw it integrated elsewhere and decided to browse the source code in hopes to borrow improvement ideas for the bot I've got. And saw an opportunity to share some of my knowledge :)

https://github.com/sanitizers/patchback-github-app/blob/master/patchback/event_handlers.py.

@carloscastrojumo
Copy link
Owner

No worries, appreciate the knowledge share, there's always space for improvement. Thank you :)

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

No branches or pull requests

2 participants