actions / actions/toolkit

Unexpected HTTP response: 403 when downloading tool from github.com

Open
#986 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
Calling actions/tool-cache downloadTool to download tool from github.com resulted in a 403.

const downloadPath: string = await tc.downloadTool(
      "https://github.com/step-security/agent/releases/download/v0.8.6/agent_0.8.6_linux_amd64.tar.gz"
    )

resulted in Unexpected HTTP response: 403 . This was a transient error. It usually does not happen.

I was not able to find a previous issue of this type in this repo, so creating a new one.
I understand that the client tool cannot do much if the service returns a 403, but I am trying to understand if you know of best practices to avoid this for github.com. I believe this is because of rate-limiting, and I have seen some actions use the GITHUB_TOKEN to overcome this, example here. Is this the recommended solution?

To Reproduce
Not able to reproduce every time. Here is an example though:
https://github.com/nvm-sh/nvm/runs/4919179993?check_suite_focus=true#step:2:5

Expected behavior
No 403 error when downloading tool from github.com

Desktop (please complete the following information):

  • OS: ubuntu-latest GitHub-hosted runner

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at actions/tool-cache's downloadTool entry point and compare the setup-node installer.ts example linked in the report. Use the linked nvm run to investigate the intermittent 403; done should be a confirmed recommendation or clearly documented limitation for downloads from github.com.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, typescript
Domain
devtools, networking
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.