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

HELP: Action failing to publish release asset with: Error: Resource not accessible by integration #572

Open
jim-junior opened this issue Jan 9, 2025 · 3 comments

Comments

@jim-junior
Copy link

I am trying to use this action to publish a release asset but it fails with this error

Found release 0.0.3 (with id=193949952)
⚠️ Unexpected error fetching GitHub release for tag refs/tags/0.0.3: HttpError: Resource not accessible by integration - https://docs.github.com/rest/releases/releases#update-a-release
Error: Resource not accessible by integration - https://docs.github.com/rest/releases/releases#update-a-release

I have used an exact copy of the workflow file before and it has been working but today i tried and it failed to run.

I have no idea why the error is occurring

To rebuild the error:

@Julienraptor01
Copy link

i got the same exact issue
maybe GitHub has change the default permissions of the default token ?
https://github.com/Julienraptor01/planeteerunstucker/actions/runs/12728727134/job/35479659229

jim-junior added a commit to jim-junior/eda that referenced this issue Jan 13, 2025
jim-junior added a commit to jim-junior/action-gh-release that referenced this issue Jan 13, 2025
Due to changes in the permissions of the default GITHUB_TOKEN secret,
updated the README example to recommend using a custom token (CUSTOM_GITHUB_TOKEN)
with appropriate "Contents" repository permissions.

See Issue softprops#572
@jim-junior
Copy link
Author

i got the same exact issue maybe GitHub has change the default permissions of the default token ? https://github.com/Julienraptor01/planeteerunstucker/actions/runs/12728727134/job/35479659229

That is most likely the reason, changed my token with a new custom one and it worked.
Its actually stated in the GitHub Docs

@Julienraptor01
Copy link

Julienraptor01 commented Jan 13, 2025

i got the same exact issue maybe GitHub has change the default permissions of the default token ? https://github.com/Julienraptor01/planeteerunstucker/actions/runs/12728727134/job/35479659229

That is most likely the reason, changed my token with a new custom one and it worked. Its actually stated in the GitHub Docs

i actually forgot to post my second comment, but i investigated the issue and it's indeed a change of default permissions
if you go in the repo settings, by default the permissions are now on restricted
you shouldn't use a custom token by default, the default token is fine, but you should use the scoped permissions system like this : https://github.com/Julienraptor01/planeteerunstucker/blob/5f765b3ef444fa2015de17298c9a7fbcca33ce6f/.github/workflows/build.yml#L3-L4

name: build
on: [ push, pull_request, workflow_dispatch ]
+ permissions:
+   contents: write
jobs:
  build:
[...]
old default permissions option (click to expand)

image

new default permissions option (click to expand)

image

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

2 participants