Skip to content

Set up git user/email when tagging the crate release #30

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

Merged

Conversation

mihaelmiklec
Copy link
Contributor

While running on github-hosted runners, it's necessary to manually set up git user/email (actions/checkout#13) for the time being.

The user/email used was taken from a suggestion in actions/checkout README:
https://github.com/actions/checkout/blob/main/README.md#push-a-commit-using-the-built-in-token

@m4t1j4
Copy link
Contributor

m4t1j4 commented Apr 15, 2025

I am just going to leave a comment, even though I am not a reviewer.

I don't know the (best) practice for this, but does it make sense to configure it to match the person who clicked the button, instead of some GitHub bot information?

@mihaelmiklec
Copy link
Contributor Author

I am just going to leave a comment, even though I am not a reviewer.

I don't know the (best) practice for this, but does it make sense to configure it to match the person who clicked the button, instead of some GitHub bot information?

I've considered pulling the triggering_actor from GitHub context and assigning that as the username and using some other email, but decided to just stick to the example they laid out in the actions/checkout README.
Even if you pull the username from the context, you can't pull the email, so you'd end up with a mismatch (i.e., an individual username and a generic email like [email protected]).

I'm not sure there's a best practice per se, but from what I've seen people tend to stick to making it clear that GitHub Actions is the one doing those actions, even if it's on behalf of someone else.

I don't have anything against going the other way either, however I thought it was best to "stick by the book" to get the workflow working as soon as possible without spending too much time on which username to use. It can always be changed in the future.

Comment on lines +86 to +87
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be "TBTLDevops" or something? We have this https://github.com/tbtldevops

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or set the name to e.g. TBTL Tech and email to [email protected]. 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github-actions is the actual bot user and suggested in actions/checkout README. You can see examples of that in our internal repos (e.g., commenting on PRs).

@mihaelmiklec mihaelmiklec force-pushed the mihael/set-git-username-email-in-publish-workflow branch from 46f7086 to 450e413 Compare April 16, 2025 12:29
While running on github-hosted runners, it's necessary to manually set
up git user/email (actions/checkout#13) for
the time being.

The user/email used was taken from a suggestion in `actions/checkout`
README:
https://github.com/actions/checkout/blob/main/README.md#push-a-commit-using-the-built-in-token
@mihaelmiklec mihaelmiklec force-pushed the mihael/set-git-username-email-in-publish-workflow branch from 450e413 to 8326bab Compare April 17, 2025 07:23
@mihaelmiklec
Copy link
Contributor Author

A dry-run was made on the yet-to-be-released bhmdoc crate:
https://github.com/blockhousetech/eudi-rust-core/actions/runs/14492864367

Everything went well, except that git pushing of the tag & publishing of the crate were run with --dry-run. Also, the creation of GH release was skipped as this is done on live runs.

@mihaelmiklec mihaelmiklec merged commit 6b5f91c into main Apr 17, 2025
9 checks passed
@mihaelmiklec mihaelmiklec deleted the mihael/set-git-username-email-in-publish-workflow branch April 17, 2025 07:27
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

Successfully merging this pull request may close these issues.

4 participants