Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ If `run_install` is a YAML string representation of either an object or an array

### `package_json_file`

**Optional** (_type:_ `string`, _default:_ `package.json`) File path to the `package.json`/[`package.yaml`](https://github.com/pnpm/pnpm/pull/1799) to read "packageManager" configuration.
**Optional** (_type:_ `string`, _default:_ `package.json`) File path to the `package.json`/[`package.yaml`/`package.json5`](https://github.com/pnpm/pnpm/pull/1799) to read "packageManager" configuration.

Comment on lines 53 to 56
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README documents package.json5 support here, but action.yml’s package_json_file input description still only mentions package.json. To keep the Marketplace/action docs consistent, please update action.yml to mention package.yaml and package.json5 as supported formats too.

Copilot uses AI. Check for mistakes.
### `standalone`

Expand Down
352 changes: 182 additions & 170 deletions dist/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@types/expand-tilde": "^2.0.2",
"@types/node": "^22.0.0",
"expand-tilde": "^2.0.2",
"json5": "^2.2.3",
"yaml": "^2.3.4",
"zod": "^3.22.4"
Comment on lines 14 to 19
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dist/index.js is the action entrypoint (action.yml), and the repo's PR workflow rebuilds and checks that dist/index.js is committed. Since this change adds a new runtime dependency (json5) and modifies parsing logic, you need to run pnpm run build and commit the updated dist/index.js; otherwise CI will fail and the published action won't include the change.

Copilot uses AI. Check for mistakes.
},
Expand Down
10 changes: 10 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/install-pnpm/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import path from 'path'
import util from 'util'
import { Inputs } from '../inputs'
import { parse as parseYaml } from 'yaml'
import JSON5 from 'json5'
import pnpmLock from './bootstrap/pnpm-lock.json'
import exeLock from './bootstrap/exe-lock.json'

Expand Down Expand Up @@ -93,6 +94,8 @@ function readTargetVersion(opts: {
const content = readFileSync(path.join(GITHUB_WORKSPACE, packageJsonFile), 'utf8');
const manifest = packageJsonFile.endsWith(".yaml")
? parseYaml(content, { merge: true })
: packageJsonFile.endsWith(".json5")
? JSON5.parse(content)
: JSON.parse(content)
Comment on lines 95 to 99
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nested ternary for selecting the manifest parser is getting hard to read/extend with multiple formats. Consider refactoring to a small helper (e.g., based on path.extname(packageJsonFile) or a switch) so future additions like .yml don’t further degrade readability.

Copilot uses AI. Check for mistakes.
packageManager = manifest.packageManager
Comment on lines 94 to 100
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description says non-YAML manifests are parsed with JSON5.parse() (which would cover both .json and .json5), but the implementation only uses JSON5.parse() for .json5 and still uses JSON.parse() for .json. Either update the description or simplify the logic to use JSON5.parse() for all non-YAML files (since JSON5 is a superset of JSON).

Copilot uses AI. Check for mistakes.
devEngines = manifest.devEngines
Expand Down
Loading