mirror of
https://gitea.com/actions/setup-node.git
synced 2025-08-02 13:28:53 +08:00
Fix node-version-file interprets entire package.json as a version (#865)
This commit is contained in:
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}`);
|
||||
}
|
||||
|
Reference in New Issue
Block a user