-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
ci: give request-review action permissions to fetch teams #51140
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
The token must have organization permissions to read teams, the github token only has scoped permissions on the repo but not on the org, so we need to use a PAT. Signed-off-by: Ferdinand Thiessen <[email protected]>
| if: github.event.pull_request.requested_reviewers[1] == null | ||
|
|
||
| permissions: | ||
| pull-requests: write |
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 think this is no longer needed, no?
As we now use the PAT permissions.
| if: needs.changes.outputs.backend == 'true' | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| GH_TOKEN: ${{ secrets.COMMAND_BOT_PAT }} |
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.
then we need to restrict it and can not run it for forks...
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.
cannot run it for forks
would be bad. But we either need a PAT or a GitHub App token.
Otherwise we need to choose the CODEOWNERS way.
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.
What @nickvergessen means is this I think
- name: Disabled on forks
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
run: |
echo 'Can not run this action on forks'
exit 1| pull-requests: write | ||
|
|
||
| steps: | ||
| - name: Assign backend engineers |
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.
| - name: Assign backend engineers | |
| - name: Disabled on forks | |
| if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} | |
| run: | | |
| echo 'Can not run this action on forks' | |
| exit 1 | |
| - name: Assign backend engineers |
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.
But then this does not make much sense as most PRs we need this come from new community people.
We should probably just add the teams to the codeowners
The token must have organization permissions to read teams, the github token only has scoped permissions on the repo but not on the org, so we need to use a PAT.
Tested with my PAT ✅