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
+44-32Lines changed: 44 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
# Add & Commit
2
+
2
3
<ahref="https://github.com/search?o=desc&q=EndBug%2Fadd-and-commit+path%3A.github%2Fworkflows+language%3AYAML&s=&type=Code"target="_blank"title="Public workflows that use this action."><imgsrc="https://img.shields.io/endpoint?url=https%3A%2F%2Fapi-git-master.endbug.vercel.app%2Fapi%2Fgithub-actions%2Fused-by%3Faction%3DEndBug%2Fadd-and-commit%26badge%3Dtrue"alt="Public workflows that use this action."></a>
@@ -48,15 +49,15 @@ Add a step like this to your workflow:
48
49
49
50
# The arguments for the `git rm` command (see the paragraph below for more info)
50
51
# Default: ''
51
-
remove: "./dir/old_file.js"
52
+
remove: './dir/old_file.js'
52
53
53
54
# Whether to use the --signoff option on `git commit` (only `true` and `false` are accepted)
54
55
# Default: false
55
56
signoff: true
56
57
57
58
# Arguments for the git tag command (the tag name always needs to be the first word not preceded by an hyphen)
58
59
# Default: ''
59
-
tag: "v1.0.0 --force"
60
+
tag: 'v1.0.0 --force'
60
61
61
62
env:
62
63
# This is necessary in order to push a commit to the repo
@@ -82,6 +83,16 @@ The script will not stop if one of the git commands fails. E.g.: if your command
82
83
83
84
You can use the `tag` option to enter the arguments for a `git add` command. In order for the action to isolate the tag name from the rest of the arguments, it should be the first word not preceded by an hyphen (e.g. `-a tag-name -m "some other stuff"` is ok).
84
85
86
+
### Outputs:
87
+
88
+
The action provides these outputs:
89
+
90
+
- `committed`: whether the action has created a commit (`'true'` or `'false'`)
91
+
- `pushed`: whether the action has pushed to teh remote(`'true'` or `'false'`)
92
+
- `tagged`: whether the action has created a tag (`'true'` or `'false'`)
93
+
94
+
For more info on how to use outputs, see ["Context and expression syntax"](https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions).
95
+
85
96
### Examples:
86
97
87
98
Do you want to lint your JavaScript files, located in the `src` folder, with ESLint, so that fixable changes are done without your intervention? You can use a workflow like this:
@@ -90,34 +101,34 @@ Do you want to lint your JavaScript files, located in the `src` folder, with ESL
If you need to run the action on a repository that is not located in [`$GITHUB_WORKSPACE`](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-environment-variables#default-environment-variables), you can use the `cwd` option: the action uses a `cd` normal command, so the path should follow bash standards.
@@ -126,7 +137,7 @@ If you need to run the action on a repository that is not located in [`$GITHUB_W
126
137
name: Use a different repository directory
127
138
on: push
128
139
129
-
jobs:
140
+
jobs:
130
141
run:
131
142
name: Add a text file
132
143
runs-on: ubuntu-latest
@@ -135,17 +146,17 @@ jobs:
135
146
# If you need to, you can check out your repo to a different location
136
147
- uses: actions/checkout@v2
137
148
with:
138
-
path: "./pathToRepo/"
149
+
path: './pathToRepo/'
139
150
140
151
# You can make whatever type of change to the repo...
141
152
- run: echo "123" > ./pathToRepo/file.txt
142
153
143
154
# ...and then use the action as you would normally do, but providing the path to the repo
144
155
- uses: EndBug/add-and-commit@v5
145
156
with:
146
-
message: "Add the very useful text file"
147
-
add: "*.txt --force"
148
-
cwd: "./pathToRepo/"
157
+
message: 'Add the very useful text file'
158
+
add: '*.txt --force'
159
+
cwd: './pathToRepo/'
149
160
env:
150
161
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
151
162
```
@@ -186,6 +197,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
186
197
187
198
<!-- markdownlint-enable -->
188
199
<!-- prettier-ignore-end -->
200
+
189
201
<!-- ALL-CONTRIBUTORS-LIST:END -->
190
202
191
203
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
0 commit comments