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

Error "Resource not accessible by integration" on first run for commit #16

Open
sergey-s-betke opened this issue Dec 17, 2021 · 3 comments

Comments

@sergey-s-betke
Copy link

Example:

But if I run manually, it work without errors:

And I see this behavior for each pull request.

@abbgrade
Copy link

abbgrade commented Jul 7, 2022

I get the same issue, if the PR comes from @dependabot

Invoke-WebRequest: D:\a_actions\zyborg\pester-tests-report\v1.5.0\action.ps1:303
Line |
303 | Invoke-WebRequest -Headers $hdr $url -Method Post -Body ($bdy | C …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| {"message":"Resource not accessible by
| integration","documentation_url":"https://docs.github.com/rest/reference/checks#create-a-check-run"}
Error: The process 'C:\Program Files\PowerShell\7\pwsh.exe' failed with exit code 1

@natescherer
Copy link
Contributor

natescherer commented Oct 21, 2022

Figured out the cause of this. For pull requests, the github token is read only to prevent possible attacks: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/

I think the only secure way to get around this would be to add functionality to the action to save test results to an artifact in one workflow, and to digest that artifact in another workflow and post to a check run in the same way talked about in that link. Non-trivial work, but possible.

@osotechie
Copy link

I was having this issue, and did a little googling and came across this post.

https://github.com/orgs/community/discussions/60820#discussioncomment-6445767

Check your Repo Settings > Actions > Workflow Permissions and then ensure its set to Read and write permissions, not just Read repository contents and packages permissions

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

No branches or pull requests

4 participants