action-gh-release icon indicating copy to clipboard operation
action-gh-release copied to clipboard

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

Open jim-junior opened this issue 10 months ago • 7 comments

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:

jim-junior avatar Jan 09 '25 17:01 jim-junior

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

Julienraptor01 avatar Jan 12 '25 00:01 Julienraptor01

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

jim-junior avatar Jan 13 '25 09:01 jim-junior

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

Julienraptor01 avatar Jan 13 '25 09:01 Julienraptor01

I have the same issue.

  • I have permissions: contents: write set,
  • I also have the new "Read repository contents and packages permissions" set in the new Workflow Settings...
  • but I still get the same error!

Here's the workflow file:

name: Release LaTeX document and source
on:
  pull_request:
    types:
      - closed

permissions:
  contents: write

jobs:
  if_merged:
    if: github.event.pull_request.merged == true
    runs-on: ubuntu-latest
    steps:
      - name: Set up Git repository
        uses: actions/checkout@v4
      - name: Compile LaTeX document
        uses: xu-cheng/latex-action@v3
        with:
          working_directory: src
          root_file: Epp.tex
          latexmk_shell_escape: true
      - name: Release
        uses: softprops/[email protected]
        with:
          tag_name: "v1.0.${{ github.run_number }}"
          make_latest: true
          generate_release_notes: true
          preserve_order: true
          files: src/Epp.pdf
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

It's funny because

  • it works if I close a pull request that I made myself, but
  • it doesn't work if I close a pull request made by someone else.

I guess I need a newer version of action-gh-release?

EDIT Updating the version fixes the issue.

spamegg1 avatar Mar 11 '25 06:03 spamegg1

Please add this session in readme.md to tell every body !

hitsmaxft avatar Aug 21 '25 09:08 hitsmaxft

This happened again, and I had to update the version once again to fix it.

spamegg1 avatar Aug 21 '25 09:08 spamegg1

It's happening again today... on the latest version.

EDIT: ah it worked now 😕 it seems to not work when pull requests from others are merged, but works if pull requests from myself (repo owner) are merged.

spamegg1 avatar Aug 29 '25 11:08 spamegg1