2
0
mirror of https://gitea.com/actions/setup-node.git synced 2025-04-08 00:09:43 +00:00

feat: support private mirrors ()

* feat: support private mirrors

* chore: change fallback message with mirrors
This commit is contained in:
Marco Ippolito
2025-04-02 17:49:47 +02:00
committed by GitHub
parent 40337cb8f7
commit e3ce749e20
14 changed files with 322 additions and 44 deletions

@ -418,3 +418,18 @@ Please refer to the [Ensuring workflow access to your package - Configuring a pa
### always-auth input
The always-auth input sets `always-auth=true` in .npmrc file. With this option set [npm](https://docs.npmjs.com/cli/v6/using-npm/config#always-auth)/yarn sends the authentication credentials when making a request to the registries.
## Use private mirror
It is possible to use a private mirror hosting Node.js binaries. This mirror must be a full mirror of the official Node.js distribution.
The mirror URL can be set using the `mirror` input.
It is possible to specify a token to authenticate with the mirror using the `mirror-token` input.
The token will be passed as a bearer token in the `Authorization` header.
```yaml
- uses: actions/setup-node@v4
with:
node-version: '14.x'
mirror: 'https://nodejs.org/dist'
mirror-token: 'your-mirror-token'
```