You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve the error message when an invalid assignee is used in pr create #3224
@yi-Xu-0100 Thanks! I see now that you've used this flag for pr create: -a '@me'
This won't work, as the bot user github-actions is not a valid assignee for issues or PRs. If there should be an assignee for the new PR, it should be a username of a regular GitHub user.
Perhaps we need a better error message in this case.
changed the title [-]GraphQL error: Could not resolve to a User with the login of 'github-actions[bot]'.[/-][+]Improve the error message when an invalid assignee is used in `pr create`[/+]on Mar 15, 2021
@mislav I have a little confused about the above test, in which I change the config username before using gh pr. But it still has the same error about the username of github-actions[bit]. I think the auth could be changed by changing the username, Why it did not happen?
I think the auth could be changed by changing the username, Why it did not happen?
No, GitHub CLI does not respect git's user.name or user.email config options at all. These options are only used in git operations like git commit. You cannot change which user GitHub CLI authenticates as by changing a config option.
When GitHub CLI creates an object, for example a new pull request, that object will be owned by whoever owns the GITHUB_TOKEN. In the case of GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}, the authenticating user is the github-actions bot. If you want it to be someone else, that account will have to generate a personal access token, you should add that new token to the secrets in this repository, and then use it instead of the default secrets.GITHUB_TOKEN.
Activity
mislav commentedon Mar 15, 2021
Hi, could you link us to the exact code that uses GitHub CLI which results in the error you're seeing?
I'm looking at this workflow file but I can't see where GitHub CLI is being used. Thank you
yi-Xu-0100 commentedon Mar 15, 2021
@mislav about the
gh pr, I test many times. You can see the file and result.I look forward to your reply, I think
ghshould be more elegant thancurl. 😀yi-Xu-0100 commentedon Mar 15, 2021
The way to find the workflow file about the workflow.


mislav commentedon Mar 15, 2021
@yi-Xu-0100 Thanks! I see now that you've used this flag for pr create:
-a '@me'This won't work, as the bot user
github-actionsis not a valid assignee for issues or PRs. If there should be an assignee for the new PR, it should be a username of a regular GitHub user.Perhaps we need a better error message in this case.
yi-Xu-0100 commentedon Mar 15, 2021
@mislav Thanks, I think I know how to modify it. If you don’t need to track this issue, just close it without telling me. 😊
[-]GraphQL error: Could not resolve to a User with the login of 'github-actions[bot]'.[/-][+]Improve the error message when an invalid assignee is used in `pr create`[/+]SONVICHETH commentedon Mar 15, 2021
yi-Xu-0100 commentedon Mar 16, 2021
@mislav I have a little confused about the above test, in which I change the config username before using
gh pr. But it still has the same error about the username ofgithub-actions[bit]. I think the auth could be changed by changing the username, Why it did not happen?mislav commentedon Mar 16, 2021
No, GitHub CLI does not respect git's
user.nameoruser.emailconfig options at all. These options are only used in git operations likegit commit. You cannot change which user GitHub CLI authenticates as by changing a config option.When GitHub CLI creates an object, for example a new pull request, that object will be owned by whoever owns the GITHUB_TOKEN. In the case of
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}, the authenticating user is thegithub-actionsbot. If you want it to be someone else, that account will have to generate a personal access token, you should add that new token to the secrets in this repository, and then use it instead of the defaultsecrets.GITHUB_TOKEN.yi-Xu-0100 commentedon Mar 16, 2021
@mislav Thank you very much for your detailed explanation!
Use personal Github token.
Use personal Github token.