Allow customizing the `GITHUB_SERVER_URL` for GHE instances
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the enhancement
Currently, we have the Github URL hardcoded to :
const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`
https://github.com/actions/toolkit/blob/main/packages/tool-cache/src/tool-cache.ts#L596C9-L596C16
While that's fine for github.com users, that tends to cause rate limiting issues for GHE users such as
API rate limit exceeded for xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)
This is seen in action for setup-go for example as a call such as :
const releases = await tc.getManifestFromRepo(
'actions',
'go-versions',
auth,
'main'
);
Builds a call to https://api.github.com/repos/actions/go-versions/git/trees/main triggering the rate limits error explained above
Additional information
Can we leverage process.env['GITHUB_SERVER_URL' ?
Example :
Note to maintainers
If accepted, It'd be happy to pick this up
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/tool-cache/src/tool-cache.ts at the hardcoded treeUrl construction, then compare the URL handling in actions/checkout's src/url-helper.ts. Trace getManifestFromRepo to confirm the generated request uses the configured GitHub Enterprise server URL instead of api.github.com. Done means GHE users can retrieve manifests without the github.com rate-limit failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, typescript
- Domain
- devops, tooling
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100