Skip to content

Commit f4a67bb

Browse files
authored
Only use mirrorToken in getManifest if it's provided (#1548)
* Only use `mirrorToken` in `getManifest` if it's provided Signed-off-by: Timo Sand <timo.sand@f-secure.com> * `npm run build` Signed-off-by: Timo Sand <timo.sand@f-secure.com> --------- Signed-off-by: Timo Sand <timo.sand@f-secure.com>
1 parent 0355742 commit f4a67bb

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

dist/setup/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79822,7 +79822,9 @@ class OfficialBuilds extends base_distribution_1.default {
7982279822
const versionInfo = await this.getInfoFromManifest(this.nodeInfo.versionSpec, this.nodeInfo.stable, osArch, manifest);
7982379823
if (versionInfo) {
7982479824
core.info(`Acquiring ${versionInfo.resolvedVersion} - ${versionInfo.arch} from ${versionInfo.downloadUrl}`);
79825-
downloadPath = await tc.downloadTool(versionInfo.downloadUrl, undefined, this.nodeInfo.mirror ? this.nodeInfo.mirrorToken : this.nodeInfo.auth);
79825+
downloadPath = await tc.downloadTool(versionInfo.downloadUrl, undefined, this.nodeInfo.mirror && this.nodeInfo.mirrorToken
79826+
? this.nodeInfo.mirrorToken
79827+
: this.nodeInfo.auth);
7982679828
if (downloadPath) {
7982779829
toolPath = await this.extractArchive(downloadPath, versionInfo, false);
7982879830
}
@@ -79893,7 +79895,9 @@ class OfficialBuilds extends base_distribution_1.default {
7989379895
}
7989479896
getManifest() {
7989579897
core.debug('Getting manifest from actions/node-versions@main');
79896-
return tc.getManifestFromRepo('actions', 'node-versions', this.nodeInfo.mirror ? this.nodeInfo.mirrorToken : this.nodeInfo.auth, 'main');
79898+
return tc.getManifestFromRepo('actions', 'node-versions', this.nodeInfo.mirror && this.nodeInfo.mirrorToken
79899+
? this.nodeInfo.mirrorToken
79900+
: this.nodeInfo.auth, 'main');
7989779901
}
7989879902
resolveLtsAliasFromManifest(versionSpec, stable, manifest) {
7989979903
const alias = versionSpec.split('lts/')[1]?.toLowerCase();

src/distributions/official_builds/official_builds.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ export default class OfficialBuilds extends BaseDistribution {
8484
downloadPath = await tc.downloadTool(
8585
versionInfo.downloadUrl,
8686
undefined,
87-
this.nodeInfo.mirror ? this.nodeInfo.mirrorToken : this.nodeInfo.auth
87+
this.nodeInfo.mirror && this.nodeInfo.mirrorToken
88+
? this.nodeInfo.mirrorToken
89+
: this.nodeInfo.auth
8890
);
8991

9092
if (downloadPath) {
@@ -188,7 +190,9 @@ export default class OfficialBuilds extends BaseDistribution {
188190
return tc.getManifestFromRepo(
189191
'actions',
190192
'node-versions',
191-
this.nodeInfo.mirror ? this.nodeInfo.mirrorToken : this.nodeInfo.auth,
193+
this.nodeInfo.mirror && this.nodeInfo.mirrorToken
194+
? this.nodeInfo.mirrorToken
195+
: this.nodeInfo.auth,
192196
'main'
193197
);
194198
}

0 commit comments

Comments
 (0)