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: HttpError: Resource not accessible by integration Stack: HttpError: Resource not accessible by integration #53

Closed
timnolte opened this issue Mar 15, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@timnolte
Copy link

When people open up Pull Requests from a fork my unit testing step fails with the following error. Pull requests opened from branches within the same repository work fine.

Error: HttpError: Resource not accessible by integration Stack: HttpError: Resource not accessible by integration
    at /home/runner/work/_actions/lucassabreu/comment-coverage-clover/main/bin/index.js:85179:21
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
@lucassabreu
Copy link
Owner

hi @timnolte can link the workflow or copy and paste it here for me to look into it?

@lucassabreu lucassabreu added the bug Something isn't working label Mar 15, 2024
@lucassabreu lucassabreu self-assigned this Mar 15, 2024
@samliu999
Copy link

same issue here

image

@lucassabreu lucassabreu pinned this issue Mar 19, 2024
@lucassabreu
Copy link
Owner

hi @samliu999 @timnolte

sadly this looks like a limitation that github puts on the default tokens, where workflows running on forks will only have read permissions.

because of that this error is thrown when the action tries to comment (write) on the pull request.

you can still see the report on the step summary, and min/max rules will still affect the pull request.
https://github.com/oidc-wp/openid-connect-generic/actions/runs/8290877284#summary-22689633198

if you really need the comment, then you could use a PAT, but that become a risk because of the repo access that is required to comment.


i tried to explain this here (i would appreciate if y'all reviewed the text):

Restrictions on Forks
---------------------
Github Actions [imposes higher Restrictions on workflows triggered from forks in public repositories][fork],
where the default token generated will have only read permissions.
Because of that when this Action is run on pull requests from forks no comment will be created with the
coverage report, instead the report will only be shown at the steps summary.
![example of step summary with the report](./assets/summary-example.png)
If comments on pull request from forks are required for your workflow a [PAT](pat) can be used, but be aware
that doing that may open the owner of the PAT to the malicious intentions of the internet.


i also added a new option on the action called skip-comments-on-forks so it won't even try to comment if set to true.

@timnolte
Copy link
Author

Ah, OK, I sort of suspected that this could be related to GitHub permissions and requiring the use of a PAT. I like the idea of having the skip on forks option. This would allow us to keep the action in place and still get some value out of it. I was wanting to reduce the need for external services so was going to drop considering the use of CodeCov.

@lucassabreu
Copy link
Owner

i created a new release with the changes, if you spot some problem or anything reach again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants