Better usage docs
This commit is contained in:
44
README.md
44
README.md
@@ -10,30 +10,40 @@ This action lets you choose the path that you want to use when adding & committi
|
|||||||
Add a step like this to your workflow:
|
Add a step like this to your workflow:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Commit changes # This is the step name that will be displayed in your runs
|
- uses: EndBug/add-and-commit@v2 # You can change this to use a specific version
|
||||||
uses: EndBug/add-and-commit@v2 # You can change this to use a specific version
|
with:
|
||||||
with: # See more info about inputs below
|
# The name of the user that will be displayed as the author of the commit
|
||||||
|
# Default: author of the commit that triggered the run
|
||||||
author_name: Your Name
|
author_name: Your Name
|
||||||
|
|
||||||
|
# The The email of the user that will be displayed as the author of the commit
|
||||||
|
# Default: author of the commit that triggered the run
|
||||||
author_email: mail@example.com
|
author_email: mail@example.com
|
||||||
cwd: "."
|
|
||||||
message: "Your commit message"
|
# The local path to the directory where your repository is located. You should use actions/checkout first to set it up
|
||||||
path: "."
|
# Default: '.'
|
||||||
|
cwd: './path/to/the/repo'
|
||||||
|
|
||||||
|
# The message for the commit
|
||||||
|
# Default: 'Commit from GitHub Actions'
|
||||||
|
message: 'Your commit message'
|
||||||
|
|
||||||
|
# The path to stage files from
|
||||||
|
# Default: '.'
|
||||||
|
path: 'src'
|
||||||
|
|
||||||
|
# The pattern that mathces file names
|
||||||
|
# Default: '*.*'
|
||||||
pattern: "*.js"
|
pattern: "*.js"
|
||||||
force: false
|
|
||||||
|
# Whether to use the --force option on git add, in order to bypass eventual gitignores
|
||||||
|
# Default: false
|
||||||
|
force: true
|
||||||
env:
|
env:
|
||||||
|
# This is necessary in order to push a commit to the repo
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged
|
||||||
```
|
```
|
||||||
|
|
||||||
### Inputs:
|
|
||||||
|
|
||||||
- `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
|
|
||||||
- `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
|
|
||||||
- `cwd` : the working directory in which your repository is located, defaults to `.`
|
|
||||||
- `message` : the message for the commit
|
|
||||||
- `path` : the path(s) to stage files from
|
|
||||||
- `pattern` : the pattern that matches file names
|
|
||||||
- `force` : whether to use the force option on git add, in order to bypass eventual gitignores
|
|
||||||
|
|
||||||
### Environment variables:
|
### Environment variables:
|
||||||
|
|
||||||
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).
|
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).
|
||||||
|
|||||||
Reference in New Issue
Block a user