Skip to content

Improve the error message when an invalid assignee is used in pr create #3224

Open

Description

@yi-Xu-0100

Describe the bug

GraphQL error: Could not resolve to a User with the login of 'github-actions[bot]'.

Steps to reproduce the behavior

I try to use the actions to make a PR. But I don' t know how to set the git user.

Expected vs actual behavior

Create the pr successfully.

Logs

https://github.com/yi-Xu-0100/test/runs/2106162302 Use the different user, But it also got the same error.

Activity

  1. added
    bug
    on Mar 14, 2021
  2. mislav commented on Mar 15, 2021

    @mislav
    Contributor

    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

  3. added
    more-info-needed
    on Mar 15, 2021
  4. yi-Xu-0100 commented on Mar 15, 2021

    @yi-Xu-0100
    Author

    The way to find the workflow file about the workflow.
    image
    image

  5. mislav commented on Mar 15, 2021

    @mislav
    Contributor

    @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.

  6. yi-Xu-0100 commented on Mar 15, 2021

    @yi-Xu-0100
    Author

    @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. 😊

  7. added
    priority-3
    and removed
    more-info-needed
    on Mar 15, 2021
  8. 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
  9. SONVICHETH commented on Mar 15, 2021

    @SONVICHETH
  10. yi-Xu-0100 commented on Mar 16, 2021

    @yi-Xu-0100
    Author

    file: https://github.com/yi-Xu-0100/test/actions/runs/651182429/workflow, result: https://github.com/yi-Xu-0100/test/runs/2106162302

    @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?

  11. mislav commented on Mar 16, 2021

    @mislav
    Contributor

    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.

  12. yi-Xu-0100 commented on Mar 16, 2021

    @yi-Xu-0100
    Author

    @mislav Thank you very much for your detailed explanation!

  13. added
    gh-pr
    on Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggh-prpriority-3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions