-
-
Notifications
You must be signed in to change notification settings - Fork 12
perf: enable renovate to set git author when using github app token #436
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
Conversation
Signed-off-by: msclock <msclock@qq.com>
0a713f8 to
2e6ccdc
Compare
|
WIP and pending to check GITHUB_TOKEN permissions. |
| RENOVATE_TOKEN: ${{ steps.generate-token.outputs.token || secrets.RENOVATE_TOKEN }} | ||
| RENOVATE_GIT_AUTHOR: ${{ vars.RENOVATE_GIT_AUTHOR }} | ||
| run: | | ||
| if [ -n "${{ steps.generate-token.outputs.token }}" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have several concern about the logic here:
- According to the doc,
usernameis also optional, autodetected if not supplied, have you ever tried whether that works? - If the template users are using PAT and no variable
RNOVATE_GIT_AUTHORis provided, we should use the default value, but seems the default value is removed. - If the template users provide a specific value to variable
RENOVATE_GIT_AUTHOR, we should respect it whenever GitHub App is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs to further verify feasibility on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have verified the following scenes:
- only bot token(not username): it detects username and sets the correct bot account.
- bot token and git author: it still resolves to use bot account.
- bot token and not git author(use yaml default author explictly): use bot account again.
I don't known how it creates a ghost user now and feel confused.🤣
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any corresponding job logs or created pull requests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my understanding, they are two different things. The author of the pull request author is only determined by the token used when creating the pull request. So it will either be a personal account when using PAT or bot account when using token generated by GitHub App. The renovate configuration only affects the git author of the commits, as you can see in the commits tab [1][2].
[1] https://github.com/msclock/smooth7zip/pull/1/commits
[2] https://github.com/msclock/smooth7zip/pull/2/commits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@huxuan Ah! I missed that flaws after several weeks.🤣
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems we have consumed too much energy on this, if necessary, we can have a online discussion about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refer to https://docs.renovatebot.com/modules/platform/github/#running-as-a-github-app, when using self-host renovate on github, we only need to set the RENOVATE_USERNAME.
Related #400