ci: give request-review action permissions to fetch teams#51140
Closed
ci: give request-review action permissions to fetch teams#51140
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 <opensource@fthiessen.de>
susnux
commented
Feb 28, 2025
| if: github.event.pull_request.requested_reviewers[1] == null | ||
|
|
||
| permissions: | ||
| pull-requests: write |
Contributor
Author
There was a problem hiding this comment.
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 }} |
Member
There was a problem hiding this comment.
then we need to restrict it and can not run it for forks...
Contributor
Author
There was a problem hiding this comment.
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.
Member
There was a problem hiding this comment.
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
skjnldsv
reviewed
Feb 28, 2025
| pull-requests: write | ||
|
|
||
| steps: | ||
| - name: Assign backend engineers |
Member
There was a problem hiding this comment.
Suggested change
| - 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 |
Contributor
Author
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ✅