File tree Expand file tree Collapse file tree 2 files changed +12
-21
lines changed Expand file tree Collapse file tree 2 files changed +12
-21
lines changed Original file line number Diff line number Diff line change @@ -71780,18 +71780,13 @@ function parseNodeVersionFile(contents) {
71780
71780
core.warning('Node version file is not JSON file');
71781
71781
}
71782
71782
if (!nodeVersion) {
71783
- try {
71784
- const found = contents.match(/^(?:nodejs\s+)?v?(?<version>[^\s]+)$/m);
71785
- nodeVersion = (_c = found === null || found === void 0 ? void 0 : found.groups) === null || _c === void 0 ? void 0 : _c.version;
71786
- if (!nodeVersion)
71787
- throw new Error();
71788
- }
71789
- catch (err) {
71790
- // In the case of an unknown format,
71791
- // return as is and evaluate the version separately.
71792
- nodeVersion = contents.trim();
71793
- }
71783
+ const found = contents.match(/^(?:nodejs\s+)?v?(?<version>[^\s]+)$/m);
71784
+ nodeVersion = (_c = found === null || found === void 0 ? void 0 : found.groups) === null || _c === void 0 ? void 0 : _c.version;
71794
71785
}
71786
+ // In the case of an unknown format,
71787
+ // return as is and evaluate the version separately.
71788
+ if (!nodeVersion)
71789
+ nodeVersion = contents.trim();
71795
71790
return nodeVersion;
71796
71791
}
71797
71792
exports.parseNodeVersionFile = parseNodeVersionFile;
Original file line number Diff line number Diff line change @@ -506,18 +506,14 @@ export function parseNodeVersionFile(contents: string): string {
506
506
}
507
507
508
508
if ( ! nodeVersion ) {
509
- try {
510
- const found = contents . match ( / ^ (?: n o d e j s \s + ) ? v ? (?< version > [ ^ \s ] + ) $ / m) ;
511
- nodeVersion = found ?. groups ?. version ;
512
-
513
- if ( ! nodeVersion ) throw new Error ( ) ;
514
- } catch ( err ) {
515
- // In the case of an unknown format,
516
- // return as is and evaluate the version separately.
517
- nodeVersion = contents . trim ( ) ;
518
- }
509
+ const found = contents . match ( / ^ (?: n o d e j s \s + ) ? v ? (?< version > [ ^ \s ] + ) $ / m) ;
510
+ nodeVersion = found ?. groups ?. version ;
519
511
}
520
512
513
+ // In the case of an unknown format,
514
+ // return as is and evaluate the version separately.
515
+ if ( ! nodeVersion ) nodeVersion = contents . trim ( ) ;
516
+
521
517
return nodeVersion as string ;
522
518
}
523
519
You can’t perform that action at this time.
0 commit comments