action-gh-release
action-gh-release copied to clipboard
Unexpected error fetching GitHub release for tag refs/tags/v1.0.1: HttpError: Resource not accessible by integration
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
Resource not accessible by integration means lack of permission of GITHUB_TOKEN, check if GITHUB_TOKEN has Read and write permissions.
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 is right, and the config shows in:
https://github.com/user/repo/settings/actions#:~:text=Workflow%20permissions
Add the following permissions to your job:
permissions:
contents: write