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
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
# Add & Commit
2
2
3
-
You can use this GitHub Action to commit changes made in your workflow run directly to your repo: for example, you use it to lint your code, update documentation, commit updated builds and so on...
3
+
You can use this GitHub Action to commit changes made in your workflow run directly to your repo: for example, you use it to lint your code, update documentation, commit updated builds, etc....
4
4
5
5
This is **heavily** inspired by [git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) (by [Stefan Zweifel](https://github.com/stefanzweifel)): that action automatically detects changed files and commits them. While this is useful for most situations, this doesn't commit untracked files and can sometimes commit unintended changes (such as `package-lock.json` or similar, that may have happened during previous steps).
6
-
This action lets you choose the path that you want to use when adding & committing changes, so that it works as you would normally do using `git` on your machine.
6
+
This action lets you choose the path that you want to use when adding & committing changes so that it works as you would normally do using `git` on your machine.
7
7
8
8
## Usage
9
9
@@ -12,31 +12,31 @@ Add a step like this to your workflow:
12
12
```yaml
13
13
- uses: EndBug/add-and-commit@v4 # 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)
15
+
# The arguments for the `git add` command (see the paragraph below for more info)
16
16
# Default: '.'
17
17
add: 'src'
18
18
19
19
# The name of the user that will be displayed as the author of the commit
20
20
# Default: author of the commit that triggered the run
21
21
author_name: Your Name
22
22
23
-
# The The email of the user that will be displayed as the author of the commit
23
+
# The email of the user that will be displayed as the author of the commit
24
24
# Default: author of the commit that triggered the run
# The local path to the directory where your repository is located. You should use actions/checkout first to set it up
28
28
# Default: '.'
29
29
cwd: './path/to/the/repo'
30
30
31
-
# Whether to use the --force option on git add, in order to bypass eventual gitignores
31
+
# Whether to use the --force option on `git add`, in order to bypass eventual gitignores
32
32
# Default: false
33
33
force: true
34
34
35
35
# The message for the commit
36
36
# Default: 'Commit from GitHub Actions'
37
37
message: 'Your commit message'
38
38
39
-
# The arguments for the git rm command (see the paragraph below for more info)
39
+
# The arguments for the `git rm` command (see the paragraph below for more info)
40
40
# Default: ''
41
41
remove: "./dir/old_file.js"
42
42
@@ -48,17 +48,17 @@ Add a step like this to your workflow:
48
48
### Environment variables:
49
49
50
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).
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.
51
+
That said, you can just copy the example line and not 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.
52
52
53
53
### Adding files:
54
54
55
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
-
The script will not stop if one the git commands fails. E.g.: if your command shows a "fatal: pathspec 'yourFile' did not match any files" error the action will go on.
56
+
The script will not stop if one of the git commands fails. E.g.: if your command shows a "fatal: pathspec 'yourFile' did not match any files" error the action will go on.
57
57
58
58
### Deleting files:
59
59
60
60
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.
61
-
The script will not stop if one the git commands fails. E.g.: if your command shows a "fatal: pathspec 'yourFile' did not match any files" error the action will go on.
61
+
The script will not stop if one of the git commands fails. E.g.: if your command shows a "fatal: pathspec 'yourFile' did not match any files" error the action will go on.
62
62
63
63
### Examples:
64
64
@@ -110,7 +110,7 @@ jobs:
110
110
runs-on: ubuntu-latest
111
111
112
112
steps:
113
-
# If you need to, you can checkout your repo to a different location
113
+
# If you need to, you can check out your repo to a different location
0 commit comments