You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-39Lines changed: 39 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
# YAML Update Action
2
2
3
-
Update values in an existing YAML or JSON File. Push this updated File to an existing branch or create a new branch. Open a PullRequest to a configurable targetBranch. It is also posible to change the file locally without commiting the change.
3
+
Update values in an existing YAML or JSON File. Push this updated File to an existing branch or create a new branch. Open a PullRequest to a configurable targetBranch. It is also possible to change the file locally without committing the change.
4
4
5
5
6
6
## Use Cases
7
7
8
-
### Change a local YAML file without commiting the change
8
+
### Change a local YAML file without committing the change
9
9
10
10
With the latest release, the content of your actual file will be updated by default. So, you just need to skip the commit of your change.
|valueFile | relative path from the Workspace Directory | _required_ Field if `changes` is not used |
88
-
|propertyPath| PropertyPath for the new value, JSONPath supported | _required_ Field if `changes` is not used |
89
-
|value | New value for the related PropertyPath | _required_ Field if `changes` is not used |
90
-
|changes | Configure changes on multiple values and/or multiple files. Expects all changes as JSON, supported formats are `{"filepath":{"propertyPath":"value"}}` and `{"propertyPath":"value"}`. If you use the second format, it uses the filepath provided from the `valueFile` intput. ||
91
-
|updateFile | **(deprected)** the updated content will be written into the actual file by default | `false` |
92
-
|workDir | Relative location of the configured `repository` | . | |
93
-
|format | Specify the used format parser of your file. WIll be guessed by file extension if not provided and uses YAML as fallback. Supports `YAML` and `JSON` ||
94
-
|method | Configures the processing of none existing properties. Possible values: `CreateOrUpdate`, `Update`, `Create` | `CreateOrUpdate` |
95
-
|noCompatMode| Removes quotes from reserved words, like Y, N, yes, no, on, etc. | `false` |
|valueFile | relative path from the Workspace Directory | _required_ Field if `changes` is not used |
88
+
|propertyPath| PropertyPath for the new value, JSONPath supported | _required_ Field if `changes` is not used |
89
+
|value | New value for the related PropertyPath | _required_ Field if `changes` is not used |
90
+
|changes | Configure changes on multiple values and/or multiple files. Expects all changes as JSON, supported formats are `{"filepath":{"propertyPath":"value"}}` and `{"propertyPath":"value"}`. If you use the second format, it uses the filepath provided from the `valueFile` intput. | |
91
+
|updateFile | **(deprecated)** the updated content will be written into the actual file by default | `false` |
92
+
|workDir | Relative location of the configured `repository` | . | |
93
+
|format | Specify the used format parser of your file. WIll be guessed by file extension if not provided and uses YAML as fallback. Supports `YAML` and `JSON` | |
94
+
|method | Configures the processing of none existing properties. Possible values: `CreateOrUpdate`, `Update`, `Create` | `CreateOrUpdate` |
95
+
|noCompatMode| Removes quotes from reserved words, like Y, N, yes, no, on, etc. | `false` |
96
96
97
97
#### Methods
98
98
99
99
Determine the behavior for none existing properties or array elements.
100
100
101
-
| Enum | Description |
102
-
|----------------|-------------|
103
-
| CreateOrUpdate | Updates existing values or creates them if not available |
104
-
| Update | Updates existing values, skips the change if not |
|commitChange | Commit the change to __branch__ with the given __message__ | `true` |
112
-
|message | Commit message for the changed YAML file | '' |
113
-
|labels | Comma separated list of labels, e.g. "feature, yaml-updates" | 'yaml-updates' |
114
-
|createPR | Create a PR from __branch__ to __targetBranch__. Use 'true' to enable it | `true` |
115
-
|title | Custom title for the created Pull Request | 'Merge: {{message}}' |
116
-
|description | Custom description for the created Pull Request | '' |
117
-
|targetBranch | Opens a PR from __branch__ to __targetBranch__ if createPR is set to 'true' | `master` |
118
-
|repository | The Repository where the YAML file is located and should be updated. You have to checkout this repository too and set the working-directory for this action to the same as the repository. See the example below | ${{github.repository}} |
119
-
|branch | The updated YAML file will be commited to this branch, branch will be created if not exists | `master` |
120
-
|masterBranchName| Branch name of your master branch | `master` |
121
-
|githubAPI | BaseURL for all GitHub REST API requests | https://api.github.com |
122
-
|token | GitHub API Token which is used to create the PR, have to have right permissions for the selected repository | ${{github.token}} |
123
-
|commitUserName | Name used for the commit user | GitHub Actions |
124
-
|commitUserEmail | Email address used for the commit user | actions@github.com |
|commitChange | Commit the change to __branch__ with the given __message__ | `true` |
112
+
|message | Commit message for the changed YAML file | '' |
113
+
|labels | Comma separated list of labels, e.g. "feature, yaml-updates" | 'yaml-updates' |
114
+
|createPR | Create a PR from __branch__ to __targetBranch__. Use 'true' to enable it | `true` |
115
+
|title | Custom title for the created Pull Request | 'Merge: {{message}}' |
116
+
|description | Custom description for the created Pull Request | '' |
117
+
|targetBranch | Opens a PR from __branch__ to __targetBranch__ if createPR is set to 'true' | `master` |
118
+
|repository | The Repository where the YAML file is located and should be updated. You have to checkout this repository too and set the working-directory for this action to the same as the repository. See the example below | ${{github.repository}} |
119
+
|branch | The updated YAML file will be committed to this branch, branch will be created if not exists | `master` |
120
+
|masterBranchName| Branch name of your master branch | `master` |
121
+
|githubAPI | BaseURL for all GitHub REST API requests | https://api.github.com |
122
+
|token | GitHub API Token which is used to create the PR, have to have right permissions for the selected repository | ${{github.token}} |
123
+
|commitUserName | Name used for the commit user | github-actions[bot] |
124
+
|commitUserEmail | Email address used for the commit user | 41898282+github-actions[bot]@users.noreply.github.com |
125
125
126
126
### Output
127
127
128
128
- `commit`Git Commit SHA
129
-
- `pull_request`Git PR Informations
129
+
- `pull_request`Git PR Information
130
130
131
-
## Debug Informations
131
+
## Debug Information
132
132
133
-
Enable Debug mode to get informations about
133
+
Enable Debug mode to get information about
134
134
135
135
- YAML parse and update results
136
136
- Git Steps
@@ -139,7 +139,7 @@ Enable Debug mode to get informations about
139
139
140
140
In this first version the updated YAML file will not be patched. It is parsed into JSON, after the update its converted back to YAML. This means that comments and blank lines will be removed in this process and the intend of the updated content can be different to the previous.
141
141
142
-
By default each value will be interpreted as string. To use other kinds of value types you can use the specified YAML tags as shown here: [JS-YAML -Supported YAML types](https://github.com/nodeca/js-yaml#supported-yaml-types). Use this syntax as string, see the [test workflows](https://github.com/fjogeleit/yaml-update-action/blob/main/.github/workflows/test.yml) as example
142
+
By default, each value will be interpreted as string. To use other kinds of value types you can use the specified YAML tags as shown here: [JS-YAML -Supported YAML types](https://github.com/nodeca/js-yaml#supported-yaml-types). Use this syntax as string, see the [test workflows](https://github.com/fjogeleit/yaml-update-action/blob/main/.github/workflows/test.yml) as example
Copy file name to clipboardExpand all lines: action.yml
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ inputs:
23
23
description: 'Configures the processing of none existing properties. Possible values: CreateOrUpdate, Update, Create'
24
24
changes:
25
25
required: false
26
-
description: 'Map of changes for a single or multiple files as JSON. Supports following formats: { "filepath": {"propertyPath": "value"}} or {"propertyPath": "value"}. If filepath is not provided it fallsback to the path configured under valueFile.'
26
+
description: 'Map of changes for a single or multiple files as JSON. Supports following formats: { "filepath": {"propertyPath": "value"}} or {"propertyPath": "value"}. If filepath is not provided it falls back to the path configured under valueFile.'
27
27
branch:
28
28
required: false
29
29
description: 'Branch to commit the change, will be created if not exist'
@@ -83,11 +83,11 @@ inputs:
83
83
commitUserName:
84
84
description: Name used for the commit user
85
85
required: false
86
-
default: GitHub Actions
86
+
default: 'github-actions[bot]'
87
87
commitUserEmail:
88
88
description: Email address used for the commit user
0 commit comments