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
+27-17Lines changed: 27 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,30 +10,40 @@ This action lets you choose the path that you want to use when adding & committi
10
10
Add a step like this to your workflow:
11
11
12
12
```yaml
13
-
- name: Commit changes # This is the step name that will be displayed in your runs
14
-
uses: EndBug/add-and-commit@v2 # You can change this to use a specific version
15
-
with: # See more info about inputs below
13
+
- uses: EndBug/add-and-commit@v2 # You can change this to use a specific version
14
+
with:
15
+
# The name of the user that will be displayed as the author of the commit
16
+
# Default: author of the commit that triggered the run
16
17
author_name: Your Name
18
+
19
+
# The The email of the user that will be displayed as the author of the commit
20
+
# Default: author of the commit that triggered the run
17
21
author_email: mail@example.com
18
-
cwd: "."
19
-
message: "Your commit message"
20
-
path: "."
22
+
23
+
# The local path to the directory where your repository is located. You should use actions/checkout first to set it up
24
+
# Default: '.'
25
+
cwd: './path/to/the/repo'
26
+
27
+
# The message for the commit
28
+
# Default: 'Commit from GitHub Actions'
29
+
message: 'Your commit message'
30
+
31
+
# The path to stage files from
32
+
# Default: '.'
33
+
path: 'src'
34
+
35
+
# The pattern that mathces file names
36
+
# Default: '*.*'
21
37
pattern: "*.js"
22
-
force: false
38
+
39
+
# Whether to use the --force option on git add, in order to bypass eventual gitignores
40
+
# Default: false
41
+
force: true
23
42
env:
43
+
# This is necessary in order to push a commit to the repo
24
44
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged
25
45
```
26
46
27
-
### Inputs:
28
-
29
-
- `author_name` : the name of the user that will be displayed as the author of the commit, defaults to the author of the commit that triggered the run
30
-
- `author_email` : the email of the user that will be displayed as the author of the commit, defaults to the author of the commit that triggered the run
31
-
- `cwd` : the working directory in which your repository is located, defaults to `.`
32
-
- `message` : the message for the commit
33
-
- `path` : the path(s) to stage files from
34
-
- `pattern` : the pattern that matches file names
35
-
- `force` : whether to use the force option on git add, in order to bypass eventual gitignores
36
-
37
47
### Environment variables:
38
48
39
49
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).
0 commit comments