Skip to content
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

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

Open
nrb opened this issue Jul 27, 2020 · 5 comments · May be fixed by #30
Open

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

nrb opened this issue Jul 27, 2020 · 5 comments · May be fixed by #30

Comments

@nrb
Copy link

nrb commented Jul 27, 2020

Given the following workflow:

name: 'Auto Assign PR Reviewers'
on: pull_request

jobs: 
  add-reviews:
    runs-on: ubuntu-latest
    steps:
      - uses: kentaro-m/auto-assign-action@v1.1.1
        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/auto-assign-action@v1.1.1
  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.

@bogdandrutu
Copy link

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

@bogdandrutu
Copy link

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.

@WuZhuoran
Copy link

WuZhuoran commented Oct 3, 2020

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/auto-assign-action@v1.1.2
        with:
          repo-token: '${{ secrets.GITHUB_TOKEN }}'
          configuration-path: ".github/auto_assign.yml" # Only needed if you use something other than .github/auto_assign.yml

@electrovir
Copy link

permissions needed:

permissions:
  contents: read
  pull-requests: write

#136 (comment)

@marten-nilsson
Copy link

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

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants