auto-assign-action
auto-assign-action copied to clipboard
`[warning]Resource not accessible by integration` when running against PRs
Given the following workflow:
name: 'Auto Assign PR Reviewers'
on: pull_request
jobs:
add-reviews:
runs-on: ubuntu-latest
steps:
- uses: kentaro-m/[email protected]
with:
configuration-path: ".github/auto_assign.yml"
repo-token: '${{ secrets.GITHUB_TOKEN }}'
And the following auto_assign.yml
:
addReviewers: true
addAssignees: author
reviewers:
- nrb
- ashish-amarnath
- carlisia
I see the following output when running this action against all PRs
Run kentaro-m/[email protected]
with:
configuration-path: .github/auto_assign.yml
repo-token: ***
##[warning]Resource not accessible by integration
##[warning]Resource not accessible by integration
I'm not quite sure what I've got wrong. You can see the directory structure at https://github.com/vmware-tanzu/velero/tree/main/.github
I was also seeing this behavior without the GITHUB_TOKEN
, and added it thinking that would give the action access to act on the repository.
I have the same problem, and the action does not assign any reviewer/assignees. Any help would be appreciated.
I found the solution for this, you need to use on: pull_request_target
because that runs with the right set of permissions to allow the action to set labels, maybe @kentaro-m you can add this to the readme.
I got the same issue.
And I found that after I change to on: pull_request_target
It shows the following after submit PR.
The yml I used is:
name: 'Auto Assign'
on: pull_request_target
jobs:
add-reviews:
runs-on: ubuntu-latest
steps:
- uses: kentaro-m/[email protected]
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
configuration-path: ".github/auto_assign.yml" # Only needed if you use something other than .github/auto_assign.yml
permissions needed:
permissions:
contents: read
pull-requests: write
https://github.com/kentaro-m/auto-assign-action/issues/136#issuecomment-1619235502
When i got this error i had to solve it with setting the "Workflow permissions" on org level