auto-assign-action icon indicating copy to clipboard operation
auto-assign-action copied to clipboard

`[warning]Resource not accessible by integration` when running against PRs

Open nrb opened this issue 4 years ago • 5 comments

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.

nrb avatar Jul 27 '20 22:07 nrb

I have the same problem, and the action does not assign any reviewer/assignees. Any help would be appreciated.

bogdandrutu avatar Aug 10 '20 23:08 bogdandrutu

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.

bogdandrutu avatar Aug 20 '20 17:08 bogdandrutu

I got the same issue. And I found that after I change to on: pull_request_target It shows the following after submit PR.

Screen Shot 2020-10-02 at 9 59 46 PM

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

WuZhuoran avatar Oct 03 '20 05:10 WuZhuoran

permissions needed:

permissions:
  contents: read
  pull-requests: write

https://github.com/kentaro-m/auto-assign-action/issues/136#issuecomment-1619235502

electrovir avatar Aug 17 '23 16:08 electrovir

When i got this error i had to solve it with setting the "Workflow permissions" on org level

image

image

marten-nilsson avatar Dec 07 '23 09:12 marten-nilsson