actions-marketplace-validations/GitHub Change Json
Github action which lets you to change a value from a json file (e.g. package.json).
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stale
- License
- None
Inputs
| name | description | required | default |
|---|---|---|---|
| path | Path to the JSON file you want to update | yes | — |
| key | Key to modify (supports dot notation for nested keys, e.g. "compilerOptions.target". Numeric segments are array indices, e.g. "items.0.name") | no | — |
| value | Value to set for the key | no | — |
| type | Type of the value: string (default), number, boolean, or json | no | string |
| commit | Boolean flag to commit and push the changes to the repository | no | false |
| signoff | Add Signed-off-by trailer to the commit message (for DCO compliance) | no | false |
| delete | Delete the specified key instead of setting a value | no | false |
| merge | Deep merge a JSON object into the existing value instead of replacing it | no | false |
| dry-run | Preview changes without modifying the file | no | false |
| create-if-missing | Create the file with an empty JSON object if it does not exist | no | false |
| changes | JSON array of changes to apply. Each item: {"key": "...", "value": "...", "type": "...", "delete": true/false, "merge": true/false}. Overrides key/value/type/delete/merge inputs. | no | — |
| schema | Path or URL to a JSON Schema file to validate the result against. Validation runs before writing. | no | — |
Outputs
| name | description |
|---|---|
| old-value | The previous value of the modified key (string for single key, JSON object for multiple keys) |
| new-value | The new value that was set (string for single key, JSON object for multiple keys) |
| modified | Whether the file content was actually changed ('true' or 'false') |