1
0
mirror of https://github.com/pnpm/action-setup.git synced 2026-06-14 15:43:46 +08:00

fix: use JSON parser for package.json instead of JSON5

This commit is contained in:
TAKAHiRO TOMiNAGA
2025-12-07 10:41:18 +09:00
parent bfbaba77ef
commit be2217eb08

View File

@@ -65,7 +65,9 @@ async function readTarget(opts: {
const content = readFileSync(path.join(GITHUB_WORKSPACE, packageJsonFile), 'utf8');
({ packageManager } = packageJsonFile.endsWith(".yaml")
? YAML.parse(content, { merge: true })
: JSON5.parse(content)
: packageJsonFile.endsWith(".json5")
? JSON5.parse(content)
: JSON.parse(content)
)
} catch (error: unknown) {
// Swallow error if package.json doesn't exist in root