diff --git a/src/index.ts b/src/index.ts index 800fb6e..80becd4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -138,8 +138,16 @@ async function run(): Promise { : await findManifest(process.cwd()) if (manifestFile) { core.info(`Found manifest.json at ${manifestFile}`) - const manifest = JSON.parse(await fs.readFile(manifestFile, 'utf8')) + + let manifestStringData = await fs.readFile(manifestFile, 'utf-8') + if (manifestStringData.startsWith('\ufeff')) { + core.info('Removing BOM from manifest.json') + manifestStringData = manifestStringData.substring(1) + } + + const manifest = JSON.parse(manifestStringData) requestedVersion = manifest.gameVersion + core.info(`Inferred version: ${requestedVersion}`) } else { core.error('No manifest.json found and no version specified.')