Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mirror-url parameter to allow downloading Node.js from a custom URL #1211

Closed
wants to merge 26 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
check-latest
  • Loading branch information
aparnajyothi-y committed Jan 30, 2025
commit a7b5311f2bcf06d5385bc89081c9292eba046888
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ inputs:
check-latest:
description: 'Set this option if you want the action to check for the latest available version that satisfies the version spec.'
default: false
mirrorURL:
mirror-url:
description: 'Custom mirror URL to download Node.js from (optional)'
required: false
registry-url:
6 changes: 5 additions & 1 deletion dist/setup/index.js
Original file line number Diff line number Diff line change
@@ -100668,6 +100668,10 @@ class OfficialBuilds extends base_distribution_1.default {
const nodeJsVersions = yield this.getNodeJsVersions();
const versions = this.filterVersions(nodeJsVersions);
const evaluatedVersion = this.evaluateVersions(versions);
if (this.nodeInfo.checkLatest) {
const evaluatedVersion = yield this.findVersionInDist(nodeJsVersions);
this.nodeInfo.versionSpec = evaluatedVersion;
}
if (!evaluatedVersion) {
throw new Error(`Unable to find Node version '${this.nodeInfo.versionSpec}' for platform ${this.osPlat} and architecture ${this.nodeInfo.arch}.`);
}
@@ -100808,7 +100812,7 @@ function run() {
if (!arch) {
arch = os_1.default.arch();
}
const mirrorURL = core.getInput('mirrorURL').trim(); // .trim() to remove any accidental spaces
const mirrorURL = core.getInput('mirror-url').trim(); // .trim() to remove any accidental spaces
if (version) {
const token = core.getInput('token');
const auth = !token ? undefined : `token ${token}`;
5 changes: 5 additions & 0 deletions src/distributions/official_builds/official_builds.ts
Original file line number Diff line number Diff line change
@@ -318,6 +318,11 @@ export default class OfficialBuilds extends BaseDistribution {
const versions = this.filterVersions(nodeJsVersions);
const evaluatedVersion = this.evaluateVersions(versions);

if (this.nodeInfo.checkLatest) {
const evaluatedVersion = await this.findVersionInDist(nodeJsVersions);
this.nodeInfo.versionSpec = evaluatedVersion;
}

if (!evaluatedVersion) {
throw new Error(
`Unable to find Node version '${this.nodeInfo.versionSpec}' for platform ${this.osPlat} and architecture ${this.nodeInfo.arch}.`
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ export async function run() {
arch = os.arch();
}

const mirrorURL = core.getInput('mirrorURL').trim(); // .trim() to remove any accidental spaces
const mirrorURL = core.getInput('mirror-url').trim(); // .trim() to remove any accidental spaces


if (version) {