Merge 914052aadc into 12b7ff3796
This commit is contained in:
commit
f11713bc04
4 changed files with 73 additions and 6 deletions
15
dist/cache-save/index.js
vendored
15
dist/cache-save/index.js
vendored
|
|
@ -92809,8 +92809,19 @@ function getNodeVersionFromFile(versionFilePath) {
|
|||
catch {
|
||||
core.info('Node version file is not JSON file');
|
||||
}
|
||||
const found = contents.match(/^(?:node(js)?\s+)?v?(?<version>[^\s]+)$/m);
|
||||
return found?.groups?.version ?? contents.trim();
|
||||
let versionFileContents = contents;
|
||||
if (path.basename(versionFilePath) === '.nvmrc') {
|
||||
versionFileContents = contents
|
||||
.split(/\r?\n/)
|
||||
.map(line => line.replace(/#.*/, '').trim())
|
||||
.filter(Boolean)
|
||||
.join('\n');
|
||||
if (!versionFileContents) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
const found = versionFileContents.match(/^(?:node(js)?\s+)?v?(?<version>[^\s]+)$/m);
|
||||
return found?.groups?.version ?? versionFileContents.trim();
|
||||
}
|
||||
async function printEnvDetailsAndSetOutput() {
|
||||
core.startGroup('Environment details');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue