英文:
Change display name for GitHub Actions Bot commit
问题
如何更改 GitHub Actions 机器人在提交上的显示名称?
目前,我正在使用以下工作流 Git 参数:
- name: 配置 Git
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "GitHub Actions [Bot]"
- name: 提交文件
run: |
git add ${{github.workspace}}/lib/bin/*
git diff-index --quiet HEAD || git commit --author="GitHub Actions [Bot] <github-actions[bot]@users.noreply.github.com>" -m "Commited compiled binaries"
结果看起来类似于这样:
github-actions[bot] Commited compiled binaries
但我想要的结果是这样的,就像我在配置中指定的那样:
GitHub Actions [Bot] Commited compiled binaries
是否有可能更改显示名称?
英文:
how can I change the display name for the GitHub Actions bot on a commit?
Currently I am using this workflow git parameters:
- name: Configure Git
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "GitHub Actions [Bot]"
- name: Commit files
run: |
git add ${{github.workspace}}/lib/bin/*
git diff-index --quiet HEAD || git commit --author="GitHub Actions [Bot] <github-actions[bot]@users.noreply.github.com>" -m "Commited compiled binaries"
The result looks something like this:
github-actions[bot] Commited compiled binaries
But I want a result like this, like I specified in the config...:
GitHub Actions [Bot] Commited compiled binaries
Is this even possible to change the display name?
答案1
得分: 0
是的,这是可能的,技术上你做得对(--author
选项对于git-commit(1)
看起来多余),但github-actions[bot]@users.noreply.github.com
是Github已知的电子邮件,因此在Microsoft Github上进行的电子邮件到用户的转换会生效,并且将使用用户名/头像。
使用不同的电子邮件地址,你可以选择要显示的名称,只要该电子邮件对于Microsoft Github是未知的,该名称就会被用来代替用户名,并且头像将被留空。
这不会影响git的历史记录,只会影响通过HTTP在超文本界面上在github.com
上显示的提交。
英文:
Yes, it is possible and technically you're doing it right (the --author
option for git-commit(1)
looks superfluous), but github-actions[bot]@users.noreply.github.com
is a known email to Github, henceforth the email-to-user translation on Microsoft Github is in effect and the username / avatar is used.
Use a different emailaddress and you can choose the name to display and as long as the email is unknown to Microsoft Github, that name will be used instead of the username and the avatar is blanked.
The git history is not affected by this, it is only the display of the commits on github.com
via HTTP in the hypertext interface.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论