srggrs / assign-one-project-github-action

Automatically add an issue or pull request to specific GitHub Project(s) when you create and/or label them.
MIT License
169 stars 60 forks source link

Resource not accessible by integration #49

Closed ran-huang closed 4 years ago

ran-huang commented 4 years ago

Hi there,

Got this message when running the job. The same workflow runs okay in a personal repo, but not in an organization's repo, so I wonder if it's caused by issues of authorization?

{
  "message": "Resource not accessible by integration",
  "documentation_url": "https://developer.github.com/v3/projects/cards/#create-a-project-card"
}
ran-huang commented 4 years ago

Fixed this. The error occurred because I created a PR from fork. I need to create a PR directly from the upstream repo. Strange though.

srggrs commented 4 years ago

Yeah I think GitHub API does not support that just yet.... Did you create a token from the organisation repo? Also can I close #48 or that's another issue

ran-huang commented 4 years ago

Hi. The "Resource not accessible by integration" error comes back again. I notice that only Pull Requests created from the upstream repo can successfully trigger the action, and those created from fork get the "Resource not accessible by integration" error.

I didn't create a token, but just used an env GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} like you did in the examples. Is there anything wrong with this?

48 is another issue. Thank you!

srggrs commented 4 years ago

I meant using a generate token in the case of this https://github.com/srggrs/assign-one-project-github-action#organisation-or-user-project. Perhaps because the "fork" belongs to another user and not to the original repo, you need a user generate token to "authorize" the action. Does it make sense?