Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

"Resource not accessible by integration" on forks #30

Closed
vakker opened this issue Oct 26, 2021 · 6 comments
Closed

"Resource not accessible by integration" on forks #30

vakker opened this issue Oct 26, 2021 · 6 comments

Comments

@vakker
Copy link

vakker commented Oct 26, 2021

Hi,
If the action is run from a fork then it raises Resource not accessible by integration.
It seems to be related to this issue.

Maybe with the set-output feature (see here) the files could be directly piped to the comment step instead of writing to a file.

@MishaKav
Copy link
Owner

Can you be more specific? Or maybe you can share an example of what are you trying to do?

@vakker
Copy link
Author

vakker commented Nov 5, 2021

So for example this test run shows the issue.

@MishaKav
Copy link
Owner

MishaKav commented Nov 6, 2021

As I can see from your log, it successfully generated all data, but when it tries to put a comment it gets status: 403 - it's meaning your GITHUB_TOKEN didn't have permission to create comments. You can read more in Automatic token authentication.
What you can do is create the right token and pass it to params

- name: Pytest coverage comment
   uses: MishaKav/pytest-coverage-comment@main
   with:
     token: {{ secrets.GITHUB_TOKEN }}
     pytest-coverage-path: ./pytest-coverage.txt
     junitxml-path: ./pytest.xml
     hide-report: true

or specify the permissions for default GITHUB_TOKEN in your workflow:

on:
  push:
    branches: [ master ]
permissions: read-all|write-all

@MishaKav MishaKav closed this as completed Nov 6, 2021
@vakker
Copy link
Author

vakker commented Nov 7, 2021

Thanks for the answer, but I'm not sure that's really the issue. Please take a look on this discussion that elaborates the issue more that I linked earlier.

@MishaKav
Copy link
Owner

MishaKav commented Nov 9, 2021

That is the issue, when you run your workflow, the GITHUB_TOKEN that you provided didn't have permission to post a comment, because it didn't have the permission to write issue. Attach the screenshot from your workflow.

image

@MishaKav
Copy link
Owner

MishaKav commented Jun 1, 2022

you also can try this solution #68 (comment)

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

No branches or pull requests

2 participants