Skip to content

Commit ea7cddf

Browse files
committed
Better usage docs
1 parent 9acdb7d commit ea7cddf

File tree

1 file changed

+27
-17
lines changed

1 file changed

+27
-17
lines changed

README.md

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,40 @@ This action lets you choose the path that you want to use when adding & committi
1010
Add a step like this to your workflow:
1111

1212
```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
1617
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
1721
author_email: [email protected]
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: '*.*'
2137
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
2342
env:
43+
# This is necessary in order to push a commit to the repo
2444
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged
2545
```
2646
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-
3747
### Environment variables:
3848
3949
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

Comments
 (0)