checks-action icon indicating copy to clipboard operation
checks-action copied to clipboard

Error: Resource not accessible by integration

Open votemike opened this issue 1 year ago • 7 comments

I think this might be because the action requires certain permissions. I can't find these documented. It may be worth adding something about them.

votemike avatar Oct 17 '23 14:10 votemike

Hi,

Are you referring to https://github.com/LouisBrunner/checks-action/issues/35?

LouisBrunner avatar Oct 17 '23 19:10 LouisBrunner

This happens for PRs created by Dependabot also.

remisture avatar Oct 18 '23 06:10 remisture

Yes, this is due to the token having different permissions, did you check this issue linked in #35? https://github.com/actions/first-interaction/issues/10#issuecomment-1232740076

LouisBrunner avatar Oct 18 '23 07:10 LouisBrunner

I didn't spot that issue as it's closed. But my PR is not coming from a fork. It's from a different branch in the same repo. In any case, if permissions are required. Would it be worth documenting them?

votemike avatar Oct 18 '23 08:10 votemike

Sure thing, feel free to open a PR to update the documentation.

LouisBrunner avatar Oct 28 '23 12:10 LouisBrunner

I still haven't quite figured out which permissions are required. I haven't got this working yet. I'll see if I can find some time to try again and if I get it working, will add more docs.

votemike avatar Oct 28 '23 15:10 votemike

I added this at the top of my file:

permissions:
    checks: write
    contents: read

write permissions for checks as by default it's readonly, and contents set to read because when you set any permissions the rest default to none

I believe it is possible to make the token more permissible by default, but doing this instead is safer, and safer still would be to do it per-job for only the jobs that need it.

redwyre avatar Dec 20 '23 17:12 redwyre