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

Any way to use GitHub real name instead of username as the commit author? #167

Closed
ruohola opened this issue Apr 14, 2021 · 14 comments · Fixed by #181
Closed

Any way to use GitHub real name instead of username as the commit author? #167

ruohola opened this issue Apr 14, 2021 · 14 comments · Fixed by #181
Assignees
Labels
type: feature New feature or feature request
Projects

Comments

@ruohola
Copy link

ruohola commented Apr 14, 2021

Currently if a workflow step doesn't specify author_name, and I trigger the workflow, the Git commit author will show up as:

ruohola <ruohola@users.noreply.github.com>

This is of course already much nicer than having it just be some random GitHub bot email, so this is not a massive issue.

But, I'm still wondering is there any way to make it instead be?

Eero Ruohola <ruohola@users.noreply.github.com>

(naturally without harcoding author_name since that would defeat the whole purpose)

This would be nice in Git logs where the author name would then match the name that is in my other commits as well.

@ruohola ruohola added the type: question Further information is requested label Apr 14, 2021
@EndBug EndBug self-assigned this Apr 14, 2021
@EndBug EndBug added type: feature New feature or feature request and removed type: question Further information is requested labels Apr 14, 2021
@EndBug EndBug added this to To do in Main board via automation Apr 14, 2021
@EndBug
Copy link
Owner

EndBug commented Apr 14, 2021

At the moment the action just uses the github.actor variable, but we could try to get the user's name with the GitHub API
Do you think that this should be done by default or that this should be opt-in, with a particular option?

@ruohola
Copy link
Author

ruohola commented Apr 14, 2021

At the moment the action just uses the github.actor variable, but we could try to get the user's name with the GitHub API
Do you think that this should be done by default or that this should be opt-in, with a particular option?

Hard to say, I guess for not breaking anyone's existing flows a new boolean option would be best, where the default would be the existing behavior, e.g.

real_name_as_commiter_name: false

This boolean would only have an effect when auth_user would be its default empty value.

@EndBug
Copy link
Owner

EndBug commented Apr 14, 2021

Another idea would be letting users use a placeholder like, idk, actor_name, and if that's the case the action will try to fetch the name of the GitHub actor

@ruohola
Copy link
Author

ruohola commented Apr 15, 2021

Maybe the boolean would be less confusing.

Main board automation moved this from To do to Done Apr 22, 2021
@EndBug
Copy link
Owner

EndBug commented Apr 22, 2021

@all-contributors please add @ruohola for their idea

@allcontributors
Copy link
Contributor

@EndBug

I've put up a pull request to add @ruohola! 🎉

@EndBug
Copy link
Owner

EndBug commented Apr 22, 2021

Ok, I've added a default_author option that allows you to control how the action will fill missing author name and email.
If you set it to user_info the action will use your display name and your actual email (if it's public) to create the commit.
Thanks again for your contribution! I'll publish it in the next minor version

@ruohola
Copy link
Author

ruohola commented Apr 22, 2021

Ok, I've added a default_author option that allows you to control how the action will fill missing author name and email.
If you set it to user_info the action will use your display name and your actual email (if it's public) to create the commit.
Thanks again for your contribution! I'll publish it in the next minor version

I think the email should still be the repo specific email though.

@EndBug
Copy link
Owner

EndBug commented Apr 22, 2021

Hmmm, why?
Also, it's not repo-specific, since that's the email you usually sign your commits with. Anyway, GitHub won't make any difference between one user_info and github_actor, you'll notice the difference just in the commit info

@ruohola
Copy link
Author

ruohola commented Apr 22, 2021

Hmmm, why?
Also, it's not repo-specific, since that's the email you usually sign your commits with. Anyway, GitHub won't make any difference between one user_info and github_actor, you'll notice the difference just in the commit info

Oh right right, currently is just uses <ruohola@users.noreply.github.com> as the email.

@EndBug
Copy link
Owner

EndBug commented Apr 22, 2021

ℹ️ Feature published in v7.2.0 (also v7 and latest)

@suntong
Copy link

suntong commented Jul 21, 2021

Why it is failing for me please?

image

https://github.com/suntong/github_workflow/runs/3068857228?check_suite_focus=true

thanks!

@EndBug
Copy link
Owner

EndBug commented Jul 22, 2021

@suntong Looking at your profile (https://github.com/suntong), you don't have a public display name or email...

@suntong
Copy link

suntong commented Jul 22, 2021

Ah, thanks @EndBug!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature or feature request
Projects
No open projects
Main board
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants