-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yml
More file actions
68 lines (66 loc) · 2.24 KB
/
action.yml
File metadata and controls
68 lines (66 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: GitHub Change Json
description: Github action which lets you to change a value from a json file (e.g. package.json).
author: maxgfr
branding:
icon: bookmark
color: red
runs:
using: node20
main: dist/index.js
inputs:
path:
required: true
description: Path to the JSON file you want to update
key:
required: false
description: Key to modify (supports dot notation for nested keys, e.g. "compilerOptions.target". Numeric segments are array indices, e.g. "items.0.name")
value:
required: false
description: Value to set for the key
type:
required: false
description: 'Type of the value: string (default), number, boolean, or json'
default: 'string'
commit:
required: false
type: boolean
description: Boolean flag to commit and push the changes to the repository
default: false
signoff:
required: false
type: boolean
description: Add Signed-off-by trailer to the commit message (for DCO compliance)
default: false
delete:
required: false
type: boolean
description: Delete the specified key instead of setting a value
default: false
merge:
required: false
type: boolean
description: Deep merge a JSON object into the existing value instead of replacing it
default: false
dry-run:
required: false
type: boolean
description: Preview changes without modifying the file
default: false
create-if-missing:
required: false
type: boolean
description: Create the file with an empty JSON object if it does not exist
default: false
changes:
required: false
description: 'JSON array of changes to apply. Each item: {"key": "...", "value": "...", "type": "...", "delete": true/false, "merge": true/false}. Overrides key/value/type/delete/merge inputs.'
schema:
required: false
description: Path or URL to a JSON Schema file to validate the result against. Validation runs before writing.
outputs:
old-value:
description: The previous value of the modified key (string for single key, JSON object for multiple keys)
new-value:
description: The new value that was set (string for single key, JSON object for multiple keys)
modified:
description: Whether the file content was actually changed ('true' or 'false')