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

Unexpected error fetching GitHub release for tag refs/tags/v1.0.1: HttpError: Resource not accessible by integration

Open aminya opened this issue 3 years ago • 7 comments

I am trying to use this action to push binaries on the tags, but I get this error:

⚠️ Unexpected error fetching GitHub release for tag refs/tags/v1.0.1: HttpError: Resource not accessible by integration
Error: Resource not accessible by integration

https://github.com/aminya/cmove/runs/6463813402?check_suite_focus=true#step:10:48

Here is my yaml file:

      - name: Publish Tagged Release
        uses: softprops/action-gh-release@v1
        if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.CPACK_GENERATOR != '' && matrix.os == 'ubuntu-20.04' && matrix.compiler == 'llvm' }}
        with:
          files: |
            build/cmove-*.zip

https://github.com/aminya/cmove/blob/ff8e82439f44d26f29b1bb29b006447efc41f4ab/.github/workflows/ci.yml#L135

aminya avatar May 17 '22 22:05 aminya

Resource not accessible by integration means lack of permission of GITHUB_TOKEN, check if GITHUB_TOKEN has Read and write permissions.

AnimMouse avatar May 19 '22 08:05 AnimMouse

In my case, the problem was that the Workflow permissions permission in the repository settings was set to Read repository contents permission. I solved this by changing it to Read and write permissions. If you forked the repository, the default is Read only.

Hiroshiba avatar Jan 09 '23 12:01 Hiroshiba

Hiroshiba is right, and the config shows in:

https://github.com/user/repo/settings/actions#:~:text=Workflow%20permissions

kkocdko avatar Mar 30 '23 19:03 kkocdko

Add the following permissions to your job:

permissions:
  contents: write

tekumara avatar Apr 30 '23 08:04 tekumara