mirror of
https://github.com/actions/setup-node.git
synced 2026-03-04 06:51:04 +08:00
Compare commits
3 Commits
b7d110de96
...
f652807228
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f652807228 | ||
|
|
efcb663fc6 | ||
|
|
09158c28ef |
2
dist/setup/index.js
vendored
2
dist/setup/index.js
vendored
@ -81660,7 +81660,7 @@ class BaseDistribution {
|
|||||||
const dataUrl = `${initialUrl}/index.json`;
|
const dataUrl = `${initialUrl}/index.json`;
|
||||||
const headers = {};
|
const headers = {};
|
||||||
if (this.nodeInfo.mirrorToken) {
|
if (this.nodeInfo.mirrorToken) {
|
||||||
headers['Authorization'] = `Bearer ${this.nodeInfo.mirrorToken}`;
|
headers['Authorization'] = this.nodeInfo.mirrorToken;
|
||||||
}
|
}
|
||||||
const response = await this.httpClient.getJson(dataUrl, headers);
|
const response = await this.httpClient.getJson(dataUrl, headers);
|
||||||
return response.result || [];
|
return response.result || [];
|
||||||
|
|||||||
@ -470,7 +470,7 @@ Please refer to the [Ensuring workflow access to your package - Configuring a pa
|
|||||||
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.
|
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.
|
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.
|
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.
|
The token will be passed in the `Authorization` header.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
|
|||||||
@ -46,19 +46,7 @@ export const restoreCache = async (
|
|||||||
|
|
||||||
core.saveState(State.CachePrimaryKey, primaryKey);
|
core.saveState(State.CachePrimaryKey, primaryKey);
|
||||||
|
|
||||||
const isManagedByYarnBerry = await repoHasYarnBerryManagedDependencies(
|
const cacheKey = await cache.restoreCache(cachePaths, primaryKey, [keyPrefix]);
|
||||||
packageManagerInfo,
|
|
||||||
cacheDependencyPath
|
|
||||||
);
|
|
||||||
let cacheKey: string | undefined;
|
|
||||||
if (isManagedByYarnBerry) {
|
|
||||||
core.info(
|
|
||||||
'All dependencies are managed locally by yarn3, the previous cache can be used'
|
|
||||||
);
|
|
||||||
cacheKey = await cache.restoreCache(cachePaths, primaryKey, [keyPrefix]);
|
|
||||||
} else {
|
|
||||||
cacheKey = await cache.restoreCache(cachePaths, primaryKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
core.setOutput('cache-hit', Boolean(cacheKey));
|
core.setOutput('cache-hit', Boolean(cacheKey));
|
||||||
|
|
||||||
|
|||||||
@ -103,7 +103,7 @@ export default abstract class BaseDistribution {
|
|||||||
const headers = {};
|
const headers = {};
|
||||||
|
|
||||||
if (this.nodeInfo.mirrorToken) {
|
if (this.nodeInfo.mirrorToken) {
|
||||||
headers['Authorization'] = `Bearer ${this.nodeInfo.mirrorToken}`;
|
headers['Authorization'] = this.nodeInfo.mirrorToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await this.httpClient.getJson<INodeVersion[]>(
|
const response = await this.httpClient.getJson<INodeVersion[]>(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user