mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-19 21:04:45 +00:00
Fix node-version-file interprets entire package.json as a version (#865)
This commit is contained in:
parent
7247617371
commit
b39b52d121
5 changed files with 78 additions and 11 deletions
12
src/main.ts
12
src/main.ts
|
@ -105,7 +105,17 @@ function resolveVersionInput(): string {
|
|||
);
|
||||
}
|
||||
|
||||
version = parseNodeVersionFile(fs.readFileSync(versionFilePath, 'utf8'));
|
||||
const parsedVersion = parseNodeVersionFile(
|
||||
fs.readFileSync(versionFilePath, 'utf8')
|
||||
);
|
||||
|
||||
if (parsedVersion) {
|
||||
version = parsedVersion;
|
||||
} else {
|
||||
core.warning(
|
||||
`Could not determine node version from ${versionFilePath}. Falling back`
|
||||
);
|
||||
}
|
||||
|
||||
core.info(`Resolved ${versionFileInput} as ${version}`);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue