diff --git a/dist/index.js b/dist/index.js index 798e67e..caedb46 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7829,7 +7829,9 @@ function run() { core.debug('No version found, trying to find version from global.json'); const globalJsonPath = path.join(process.cwd(), 'global.json'); if (fs.existsSync(globalJsonPath)) { - const globalJson = JSON.parse(fs.readFileSync(globalJsonPath, { encoding: 'utf8' })); + const globalJson = JSON.parse( + // .trim() is necessary to strip BOM https://github.com/nodejs/node/issues/20649 + fs.readFileSync(globalJsonPath, { encoding: 'utf8' }).trim()); if (globalJson.sdk && globalJson.sdk.version) { version = globalJson.sdk.version; }