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

Solution for "Error: Resource not accessible by integration" #194

Open
zcraber opened this issue May 17, 2023 · 8 comments
Open

Solution for "Error: Resource not accessible by integration" #194

zcraber opened this issue May 17, 2023 · 8 comments

Comments

@zcraber
Copy link

zcraber commented May 17, 2023

This is not a bug report.

Just sharing a solution, that worked for me. In case anyone gets the Error: Resource not accessible by integration while running the workflow, try this:

  1. Go to your repository Settings.
  2. Select General from Actions.
  3. Under Workflow permissions, check Read and write permissions.

image

Previously, repositories had this setting enabled by default. Seems like this has been changed.

@zcraber zcraber closed this as completed May 17, 2023
@mre
Copy link
Member

mre commented May 17, 2023

Huh, thanks for the heads-up. I wonder why write permissions are required by the action. We don't write anything except for the status report at the end of the run. We don't write anything to the repo itself. Anybody has an idea what's going on? We might need to add further instructions to the readme if this is a common problem.

I will reopen this issue as I'd like to get more feedback.

@zcraber
Copy link
Author

zcraber commented May 17, 2023

Huh, thanks for the heads-up. I wonder why write permissions are required by the action. We don't write anything except for the status report at the end of the run. We don't write anything to the repo itself. Anybody has an idea what's going on? We might need to add further instructions to the readme if this is a common problem.

I will reopen this issue as I'd like to get more feedback.

I guess it's related to https://github.com/peter-evans/create-issue-from-file

image

@mre mre reopened this May 17, 2023
@mre
Copy link
Member

mre commented Jun 16, 2023

Do you still encounter this problem? I can't see any issues in any of the other pipelines so far.

@zcraber
Copy link
Author

zcraber commented Jun 16, 2023

Do you still encounter this problem? I can't see any issues in any of the other pipelines so far.

Nope, it was solved when I enabled Read and write permissions

@mre
Copy link
Member

mre commented Jun 16, 2023

Alright. Thanks for the update. Closing then.

@mre mre closed this as completed Jun 16, 2023
@AndreiCherniaev
Copy link
Contributor

AndreiCherniaev commented Sep 13, 2024

Do you still encounter this problem? I can't see any issues in any of the other pipelines so far.

Nope, it was solved when I enabled Read and write permissions

For me this also helps, great thanks! But how user of lychee-action can know? Is it possible to script before try to create issue script should check settings of the repo and make userfriendly error msg? Or may be we should add such very important note in README.md?
Before start please edit settings of your repo to enable "Read and write permissions"
Screenshort:
Read and write permissions

@mre @dscho @jacobdalamb

@mre mre reopened this Sep 13, 2024
@dscho
Copy link
Contributor

dscho commented Sep 13, 2024

This makes lots of sense, and I agree that:

Error: Resource not accessible by integration

does not clearly say:

Error: This operation is using a token that is missing some scopes;
  You may want to add `issues: write`; For more information, see
  https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#permissions

So: an alternative to default workflow permissions to read/write, and an alternative that I would prefer, personally, would be to add this top-level section to the GitHub workflow definition:

permissions:
  issues: write

Or even better: scope it to the job in the workflow that needs that permission:

jobs:
  my-job:
    permissions:
      issues: write

See a working example that can be imitated.

how user of lychee-action can know?

That's a good point, if you follow the example in the README.md, you wouldn't know. It would probably make for a fine contribution to add that permissions block with a comment along the lines # needed for create-issue-from-file to work here and here. @AndreiCherniaev wanna grab this opportunity to add a notch on your PR belt?

@mre
Copy link
Member

mre commented Oct 7, 2024

@AndreiCherniaev, are you interested in sending a pull request?

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