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
+14-16Lines changed: 14 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,10 @@ Add a step like this to your workflow:
12
12
```yaml
13
13
- uses: EndBug/add-and-commit@v2 # You can change this to use a specific version
14
14
with:
15
+
# The arguments for the git add command (see the paragraph below for more info)
16
+
# Default: '.'
17
+
add: 'src'
18
+
15
19
# The name of the user that will be displayed as the author of the commit
16
20
# Default: author of the commit that triggered the run
17
21
author_name: Your Name
@@ -32,15 +36,7 @@ Add a step like this to your workflow:
32
36
# Default: 'Commit from GitHub Actions'
33
37
message: 'Your commit message'
34
38
35
-
# The path to stage files from
36
-
# Default: '.'
37
-
path: 'src'
38
-
39
-
# The pattern that mathces file names
40
-
# Default: '*.*'
41
-
pattern: "*.js"
42
-
43
-
# The files to remove
39
+
# The arguments for the git rm command (see the paragraph below for more info)
44
40
# Default: ''
45
41
remove: "./dir/old_file.js"
46
42
@@ -54,9 +50,13 @@ Add a step like this to your workflow:
54
50
The only `env` variable required is the token for the action to run: GitHub generates one automatically, but you need to pass it through `env` to make it available to actions. You can find more about `GITHUB_TOKEN` [here](https://help.github.com/en/articles/virtual-environments-for-github-actions#github_token-secret).
55
51
With that said, you can just copy the example line and don't worry about it. If you do want to use a different token you can pass that in, but I wouldn't see any possible advantage in doing so.
56
52
53
+
### Adding files:
54
+
55
+
The action adds files using a regular `git add` command, so you can put every kind of argument in the `add` option. For example, if you don't want it to use a recursive behavior: `$(find . -maxdepth 1 -name *.js)`
56
+
57
57
### Deleting files:
58
58
59
-
You can delete files with the `remove` option: that runs a `git remove` command that will stage the files in the given path for removal. Please keep in mind that if the path is wrong the action will stop.
59
+
You can delete files with the `remove` option: that runs a `git rm` command that will stage the files in the given path for removal. Please keep in mind that if the path is wrong the action will stop.
0 commit comments