mirror of
https://github.com/actions/setup-node.git
synced 2025-09-15 10:43:59 +08:00
npm run test update
This commit is contained in:
@@ -16,11 +16,6 @@ export default class OfficialBuilds extends BaseDistribution {
|
||||
|
||||
public async setupNodeJs() {
|
||||
if (this.nodeInfo.mirrorURL) {
|
||||
if (this.nodeInfo.mirrorURL === '') {
|
||||
throw new Error(
|
||||
'Mirror URL is empty. Please provide a valid mirror URL.'
|
||||
);
|
||||
}
|
||||
let downloadPath = '';
|
||||
|
||||
try {
|
||||
@@ -32,9 +27,12 @@ export default class OfficialBuilds extends BaseDistribution {
|
||||
}
|
||||
} catch (err) {
|
||||
core.info((err as Error).message);
|
||||
core.info('Download failed');
|
||||
core.debug((err as Error).stack ?? 'empty stack');
|
||||
}
|
||||
} else {
|
||||
core.info('No mirror URL found. Falling back to default setup...');
|
||||
core.info('Setup Node.js');
|
||||
let manifest: tc.IToolRelease[] | undefined;
|
||||
let nodeJsVersions: INodeVersion[] | undefined;
|
||||
const osArch = this.translateArchToDistUrl(this.nodeInfo.arch);
|
||||
|
@@ -2,10 +2,6 @@ import BaseDistribution from '../base-distribution';
|
||||
import {NodeInputs} from '../base-models';
|
||||
|
||||
export default class RcBuild extends BaseDistribution {
|
||||
getDistributionMirrorUrl() {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
constructor(nodeInfo: NodeInputs) {
|
||||
super(nodeInfo);
|
||||
}
|
||||
|
10
src/main.ts
10
src/main.ts
@@ -33,7 +33,12 @@ export async function run() {
|
||||
arch = os.arch();
|
||||
}
|
||||
|
||||
const mirrorURL = core.getInput('mirror-url').trim(); // .trim() to remove any accidental spaces
|
||||
const mirrorURL = core.getInput('mirror-url');
|
||||
if (mirrorURL === ' ' && mirrorURL === undefined) {
|
||||
core.error(
|
||||
'Mirror URL is emptry or undefined. The default mirror URL will be used.'
|
||||
);
|
||||
}
|
||||
|
||||
if (version) {
|
||||
const token = core.getInput('token');
|
||||
@@ -116,3 +121,6 @@ function resolveVersionInput(): string {
|
||||
|
||||
return version;
|
||||
}
|
||||
export function setupNodeJs(mirrorURL: string) {
|
||||
throw new Error('Function not implemented.');
|
||||
}
|
||||
|
Reference in New Issue
Block a user