Repository navigation
Conversation
58774dc to
fb52449
Compare
andrii-bodnar
left a comment
There was a problem hiding this comment.
@minijus thanks for the PR, this is a useful feature!
The custom download path seems overcomplicated. tc.downloadTool(url, dest, auth) already takes an authorization header, retries, honours proxies, and strips the header on cross-host redirects. Could we use it and drop downloadAuthenticated, the @actions/http-client dependency, and the related tests?
Also:
- Warn when the token is withheld because the tarball is on a different origin.
- Move the
delete process.env...out ofreadInputs().
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
fb52449 to
51a7ffb
Compare
|
Thanks for the review! I've pushed the changes:
I looked into switching to
The custom code follows redirects itself and re-checks the full origin each time. Once the chain leaves the registry origin, the token is never sent again, and HTTPS-to-HTTP redirects are refused. It still uses Happy to change this if you'd rather go another way. 🤖 Generated by Claude Opus 5.5 (claude-opus-5.5) |
Summary
Adds an
npm_registry_tokeninput so the CLI can be downloaded from an authenticated npm mirror (e.g. Artifactory/Nexus) set vianpm_registry_url. Today a private registry can't be used, and users fall back touse_installed_cli: trueplus a manual install step.Changes
npm_registry_tokeninput. It is masked withcore.setSecret.Authorization: Bearer …only to URLs whose origin (scheme, host and port) matchesnpm_registry_url. This applies to the packument request and same-origin tarball downloads. Tarballs on another origin (e.g. a CDN) are downloaded without credentials.tc.downloadTool.INPUT_NPM_REGISTRY_TOKENis removed from the process environment inrun(), so the CLI and other subprocesses don't inherit the token.cli_versionwith a Renovate annotation (customManagers:githubActionsVersions).dist/is rebuilt.Example
🤖 Generated by Claude Opus 5.5 (claude-opus-5.5)