-
-
Notifications
You must be signed in to change notification settings - Fork 187
Add support for package.json5 format #191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
f5b1fd3
bfbaba7
be2217e
b58e038
c91bdab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
|
||
| }, | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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' | ||
|
|
||
|
|
@@ -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
|
||
| packageManager = manifest.packageManager | ||
|
Comment on lines
94
to
100
|
||
| devEngines = manifest.devEngines | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
README documents
package.json5support here, butaction.yml’spackage_json_fileinput description still only mentionspackage.json. To keep the Marketplace/action docs consistent, please updateaction.ymlto mentionpackage.yamlandpackage.json5as supported formats too.