xresloader/upload-to-github-release

Resource not accessible by personal access token

Closed this issue · 5 comments

Here's what happens when I try to use the action in my project:

Run xresloader/upload-to-github-release@v1.3.12
File found to upload: /home/runner/work/depstoml/depstoml/depstoml/build/libs/depstoml-0.1.jar
Try to get release by tag 0.1-2a4cf101 from overpas/depstoml
Try to get release by tag 0.1-2a4cf101 from overpas/depstoml : Not Found
Try to get draft release name 0.1-2a4cf101 or tag name 0.1-2a4cf101 from overpas/depstoml
Try to create release 0.1-2a4cf101 for overpas/depstoml
Try to create release 0.1-2a4cf101 for overpas/depstoml failed: Resource not accessible by personal access token
HttpError: Resource not accessible by personal access token
    at /home/runner/work/_actions/xresloader/upload-to-github-release/v1.3.[12](https://github.com/overpas/depstoml/actions/runs/5180430987/jobs/9334604495#step:4:13)/lib/index.js:5167:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async run (/home/runner/work/_actions/xresloader/upload-to-github-release/v1.3.12/lib/index.js:20947:[13](https://github.com/overpas/depstoml/actions/runs/5180430987/jobs/9334604495#step:4:14))
Error: Try to create release 0.1-2a4cf101 for overpas/depstoml failed: Resource not accessible by personal access token
HttpError: Resource not accessible by personal access token
    at /home/runner/work/_actions/xresloader/upload-to-github-release/v1.3.12/lib/index.js:5167:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async run (/home/runner/work/_actions/xresloader/upload-to-github-release/v1.3.12/lib/index.js:20947:13)
Start uploading asset: /home/runner/work/depstoml/depstoml/depstoml/build/libs/depstoml-0.1.jar(size: 63434[15](https://github.com/overpas/depstoml/actions/runs/5180430987/jobs/9334604495#step:4:16)1) ...
Upload asset: depstoml-0.1.jar success

As for the token, I generated a new token at Github developer settings, then copied it and added to the repository secrets under the name MY_GITHUB_TOKEN. Should I have given some specific permissions to the generated token? Something from the picture below?
image
Or what else could be the problem?

owent commented

Could you try ${{ secrets.GITHUB_TOKEN }} for alternative? This token is always available for current repository.

Replaced with ${{ secrets.GITHUB_TOKEN }}. Now there's another error

Run xresloader/upload-to-github-release@v1.3.12
File found to upload: /home/runner/work/depstoml/depstoml/depstoml/build/libs/depstoml-0.1.jar
Try to get release by tag 0.1-cf8b5739 from overpas/depstoml
Try to get release by tag 0.1-cf8b5739 from overpas/depstoml : Not Found
Try to get draft release name 0.1-cf8b5739 or tag name 0.1-cf8b5739 from overpas/depstoml
Try to create release 0.1-cf8b5739 for overpas/depstoml
Try to create release 0.1-cf8b5739 for overpas/depstoml failed: Resource not accessible by integration
HttpError: Resource not accessible by integration
    at /home/runner/work/_actions/xresloader/upload-to-github-release/v1.3.[12](https://github.com/overpas/depstoml/actions/runs/5186688895/jobs/9348116061#step:4:13)/lib/index.js:5167:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async run (/home/runner/work/_actions/xresloader/upload-to-github-release/v1.3.12/lib/index.js:20947:[13](https://github.com/overpas/depstoml/actions/runs/5186688895/jobs/9348116061#step:4:14))
Error: Try to create release 0.1-cf8b5739 for overpas/depstoml failed: Resource not accessible by integration
HttpError: Resource not accessible by integration
    at /home/runner/work/_actions/xresloader/upload-to-github-release/v1.3.12/lib/index.js:5167:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async run (/home/runner/work/_actions/xresloader/upload-to-github-release/v1.3.12/lib/index.js:20947:13)
Start uploading asset: /home/runner/work/depstoml/depstoml/depstoml/build/libs/depstoml-0.1.jar(size: 63434[15](https://github.com/overpas/depstoml/actions/runs/5186688895/jobs/9348116061#step:4:16)1) ...
Upload asset: depstoml-0.1.jar success

I suppose the reason is that read & write permissions for workflows should be granted in settings
image
However I decided to just use github cli directly instead of the action

This issue was marked as stale due to lack of activity.