xresloader / upload-to-github-release

MIT License
52 stars 10 forks source link

"Resource not accessible by integration" when uploading to other repo #59

Closed fgregg closed 3 months ago

fgregg commented 7 months ago

Thanks for a great tool!

I'm trying to upload a file to a release connected to a public repo from a github action running in a private repo, and I'm getting a "Resource not accessible by integration" error.

Here's the github action snippet:

    - name: upload to release
      uses: xresloader/upload-to-github-release@v1
      with:
        file: "new_postings.csv"
        update_latest_release: true
        target_repo: warehouse

and here's the output from GA

Run xresloader/upload-to-github-release@v1
  with:
    file: new_postings.csv
    update_latest_release: true
    target_repo: warehouse
    overwrite: false
    tags: false
    verbose: false
    token: ***
    find_draft_release_count: 32
File found to upload: /home/runner/work/unionjobs/unionjobs/new_postings.csv
Try to get latest release from labordata/warehouse
Try to update release Nightly for labordata/warehouse
Try to update release Nightly for labordata/warehouse failed: Resource not accessible by integration
HttpError: Resource not accessible by integration
    at /home/runner/work/_actions/xresloader/upload-to-github-release/v1/lib/index.js:8615:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async run (/home/runner/work/_actions/xresloader/upload-to-github-release/v1/lib/index.js:38998:32)
Error: Try to update release Nightly for labordata/warehouse failed: Resource not accessible by integration
HttpError: Resource not accessible by integration
    at /home/runner/work/_actions/xresloader/upload-to-github-release/v1/lib/index.js:8615:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async run (/home/runner/work/_actions/xresloader/upload-to-github-release/v1/lib/index.js:38998:32)
Start uploading asset: /home/runner/work/unionjobs/unionjobs/new_postings.csv(size: 118) ...
Upload asset: new_postings.csv failed => Resource not accessible by integration
HttpError: Resource not accessible by integration
    at /home/runner/work/_actions/xresloader/upload-to-github-release/v1/lib/index.js:8615:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async run (/home/runner/work/_actions/xresloader/upload-to-github-release/v1/lib/index.js:39240:40)
Start uploading asset(1 retry): /home/runner/work/unionjobs/unionjobs/new_postings.csv(size: 118) ...
============================= v4 API: query { repository (owner:"labordata", name:"warehouse") } =============================
Upload asset(1 retry): new_postings.csv failed => Resource not accessible by integration
HttpError: Resource not accessible by integration
    at /home/runner/work/_actions/xresloader/upload-to-github-release/v1/lib/index.js:8615:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async run (/home/runner/work/_actions/xresloader/upload-to-github-release/v1/lib/index.js:39240:40)
Start uploading asset(2 retry): /home/runner/work/unionjobs/unionjobs/new_postings.csv(size: 118) ...
============================= v4 API: query { repository (owner:"labordata", name:"warehouse") } =============================
Upload asset(2 retry): new_postings.csv failed => Resource not accessible by integration
HttpError: Resource not accessible by integration
    at /home/runner/work/_actions/xresloader/upload-to-github-release/v1/lib/index.js:8615:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async run (/home/runner/work/_actions/xresloader/upload-to-github-release/v1/lib/index.js:39240:40)
Start uploading asset(3 retry): /home/runner/work/unionjobs/unionjobs/new_postings.csv(size: 118) ...
============================= v4 API: query { repository (owner:"labordata", name:"warehouse") } =============================
Upload asset(3 retry): new_postings.csv failed => Resource not accessible by integration
HttpError: Resource not accessible by integration
    at /home/runner/work/_actions/xresloader/upload-to-github-release/v1/lib/index.js:8615:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async run (/home/runner/work/_actions/xresloader/upload-to-github-release/v1/lib/index.js:39240:40)
Error: Upload asset: new_postings.csv failed => Resource not accessible by integration
HttpError: Resource not accessible by integration
    at /home/runner/work/_actions/xresloader/upload-to-github-release/v1/lib/index.js:8615:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async run (/home/runner/work/_actions/xresloader/upload-to-github-release/v1/lib/index.js:39240:40)
owent commented 7 months ago

It's required to set token when upload files to another repo. The default token only has permission to current repo.

github-actions[bot] commented 4 months ago

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