Comments (9)
So it seems to be permissions related, but Iām not sure if it's intentional. It might be a GitHub API bug. The problem seems to be that the default GITHUB_TOKEN
does not have permission to request a review from a team. It doesn't appear to matter whether the repository is private or not, or whether the team is nested or not.
Here is how you can work around it:
- Create a new GitHub account that will act as a machine user.
- Add the machine user to a team that has write access for the repository.
- Log into the machine user account and create a
repo
scoped PAT. - Copy the generated PAT to a secret in your repository.
- Use the secret instead of the default
GITHUB_TOKEN
when runningcreate-pull-request
action.
from create-pull-request.
This looks like a permissions issue. Could you explain a bit more about your setup. Is the team in the same org as the repository? Does the team have collaborator (write) access to the repository? Is the repository private?
from create-pull-request.
Is the team in the same org as the repository?
Yes it is.
Does the team have collaborator (write) access to the repository?
Yes the developers
team has Write
role access to the repository.
We have a Nested Team structure as follows:
- WriteAccess Team (is the team that is assigned the "Write" Role to the repository)
|--- CI Team
|--- CI Member 1
|--- CI Member 2
|--- CI Member n
|--- Developers Team
|--- Developer Member 1
|--- Developer Member 2
|--- Developer Member n
Is the repository private?
Yes it is private.
from create-pull-request.
I'll try and find some time to reproduce the problem and see if I can find a workaround. I'm fairly sure this is not a problem with the action itself, it's likely to be a permissions related issue with the GitHub API. One thing you could try is using a PAT instead of the default GITHUB_TOKEN
. You could also experiment with a top-level (not nested) team to see if that makes a difference.
from create-pull-request.
I managed to setup an org and teams in the same way and reproduced the error. I'll see if I can figure out what the issue is and any workaround.
from create-pull-request.
Sorry for the delay in providing feedback. Using a PAT as a workaround works for us. Thank you very much for looking into the matter.
from create-pull-request.
@peter-evans - I am facing the same issue even if I use PAT token.
Below fails
- name: Create Pull Request uses: peter-evans/create-pull-request@v4 with: token: ${{ secrets.user_GITHUB_TOKEN }} branch: update-flux branch-suffix: short-commit-hash commit-message: Update to ${{ steps.update.outputs.flux_version }} title: Update to ${{ steps.update.outputs.flux_version }} body: | ${{ steps.update.outputs.flux_version }} delete-branch: true author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> team-reviewers: | admin
Below works
- name: Create Pull Request uses: peter-evans/create-pull-request@v4 with: token: ${{ secrets.user_GITHUB_TOKEN }} branch: update-flux branch-suffix: short-commit-hash commit-message: Update to ${{ steps.update.outputs.flux_version }} title: Update to ${{ steps.update.outputs.flux_version }} body: | ${{ steps.update.outputs.flux_version }} delete-branch: true author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> reviewers: thulasidassrinivasan
What am I doing wrong ? Could you Please help?
from create-pull-request.
Was able to reproduce the following error using a GitHub App for this endpoint - the issue is permissions.
{
"message": "Validation Failed",
"errors": [
"Could not resolve to a node with the global id of 'T_kwDOBnBNDs4AYoNE'."
],
"documentation_url": "https://docs.github.com/rest/reference/pulls#request-reviewers-for-a-pull-request"
}
For this endpoint to be successful the following permissions must be enabled on GitHub Apps:
Read access to metadata
Read and write access to members, pull requests, and team discussions
from create-pull-request.
I'm also facing the same issue with my new GitHub app,
I have given the required permissions for the app, but still I'm getting this error.
@loujr please let me know , if you are able to fix this issue?
from create-pull-request.
Related Issues (20)
- Unable to create new PR from old branch HOT 1
- unable to create pull request due to cherry-picker error HOT 1
- Pass parameters to commit
- Request: Document PAT permissions requirements for machine accounts HOT 2
- `push-to-fork` won't push to sibling repos in the same network HOT 3
- add a no-verify option HOT 1
- Support commenting on a PR when closing it HOT 4
- PR is geeting auto merge HOT 1
- Commit author is `web-flow`? HOT 3
- Fine-grained PATs will also work HOT 2
- Upgrade action to use node20 HOT 4
- Commit message not updated when PR is updated HOT 1
- Actions not triggering even with Custom App HOT 6
- Photo from Tajdoost
- stale info error when specified branch doesn't exist but a tag with the same name exists HOT 2
- Add no-verify option because rm -rf .git/hooks doesn't work HOT 2
- Github Action is not working HOT 1
- This isn't recognizing changes between two branches of two repos HOT 2
- using with git-crypt HOT 4
- Is it possible to fully restore all git state after the action? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from create-pull-request.