create-pull-request: `team-reviewers` option doesn't work anymore
Subject of the issue
Since 5 days ago the option to request a review from any of the owners, or later, the members of a team doesn’t work anymore with the following error:
Reviews may only be requested from collaborators. One or more of the teams you specified is not a collaborator of the company-name/repository-name repository.
Steps to reproduce
Create a PR with:
- name: Create PR
id: create-pr
if: ${{ steps.prepare-pr.outputs.create_pr == 'True' }}
uses: peter-evans/create-pull-request@v4
with:
path: reponame-repo
add-paths: node/${{ inputs.hostname }}
token: ${{ env.GITHUB_REPO_TOKEN }}
branch: EOL_${{ inputs.hostname }}
commit-message: Remove ${{ inputs.hostname }}
title: Remove ${{ inputs.hostname }}
body: ${{ env.pull_request_body }}
assignees: ${{ github.actor }}
team-reviewers: owners
labels: Prepare for removal
draft: ${{ steps.prepare-pr.outputs.remnants_warning }}
Later, I tried with the same as above, but:
team-reviewers: company-name/team-name
But that failed with same error. I also tried other things like team-reviewers: team-name and:
team-reviewers: |
company-name/team-name
All of them failed.
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 8
- Comments: 28 (15 by maintainers)
Commits related to this issue
- Seems like team reviewers is not working https://github.com/peter-evans/create-pull-request/issues/1638 Will come back if there's any progress in that issue — committed to cowprotocol/token-lists by alfetopito a year ago
- update team reviewers (#50119) Github recently changed their API, which no longer allows(reqiures) the org prefix on team reviewers. Response from github: ``` I took a look and it does seem li... — committed to sourcegraph/sourcegraph by davejrt a year ago
- Update create-pull-request action setup This updates the action from v4 to v5 and replaces the use of `team-reviewers` with `reviewers`. Background: - https://github.com/peter-evans/create-pull... — committed to flownative/versions.flownative.io by kdambekalns a year ago
I’ve made a couple of changes that I’ve released in
v5.0.0/v5.Validation Failed: "Could not resolve to a node with the global id of 'xxxxxxxxxxxxx'."to provide a clearer reason for the failure.<org>/from teams if supplied.@harpener You are getting that error because you are using the default
GITHUB_TOKEN. I’m not sure if the default token worked for requesting reviews from teams before, but it definitely does not work anymore since GitHub’s update. And I’m fairly sure that is the correct behaviour. The token must have at leastreposcope to be able to request a review. If it was working before without that then I believe it was a mistake which has now been corrected.Summary:
<org>/, as I described here.reposcope.If you don’t specify the teams correctly without the leading
<org>/, then you will see the following error:If you don’t use a PAT with
reposcope then you will see the following error:@peter-evans I should mention that in my case the team is not secret, but visible to everyone in our organization. Only the repository is private to the outside world.
The error looked like the one in this issue: https://github.com/peter-evans/create-pull-request/issues/155#issue-595037008
I’ve opened a GitHub support case because something is clearly wrong with the API and it seems difficult to reproduce and debug.
In the meantime, I’ll look into using the GraphQL API to request team reviewers, since that appears to work.
Perhaps this is the cause. Did GitHub stop allowing requesting team reviewers for private repositories under the GitHub Free billing plans recently?
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/requesting-a-pull-request-review
I can’t find any public announcement about this if they did change it recently.
Thanks @harpener, I misunderstood the conditions under which this was occurring. I’ve got it now so I’ll test some more.
@peter-evans you can find the code here and the logs here
I’ve tried multiple PAT’s, including my own which is an admin for our org and works with the
ghcli. I created a new PAT with no luck