@@ -11,13 +11,14 @@ 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
|
- name: Commit changes # This is the step name that will be displayed in your runs
|
||||||
uses: EndBug/add-and-commit@v2.0.0 # You can change this to use a specific version
|
uses: EndBug/add-and-commit@v2.1.0 # You can change this to use a specific version
|
||||||
with: # See more info about inputs below
|
with: # See more info about inputs below
|
||||||
author_name: Your Name
|
author_name: Your Name
|
||||||
author_email: mail@example.com
|
author_email: mail@example.com
|
||||||
message: "Your commit message"
|
message: "Your commit message"
|
||||||
path: "."
|
path: "."
|
||||||
pattern: "*.js"
|
pattern: "*.js"
|
||||||
|
force: false
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged
|
||||||
```
|
```
|
||||||
@@ -29,6 +30,7 @@ Add a step like this to your workflow:
|
|||||||
- `message` : the message for the commit
|
- `message` : the message for the commit
|
||||||
- `path` : the path(s) to stage files from
|
- `path` : the path(s) to stage files from
|
||||||
- `pattern` : the pattern that matches file names
|
- `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:
|
||||||
|
|
||||||
@@ -63,7 +65,7 @@ jobs:
|
|||||||
run: eslint "src/**" --fix
|
run: eslint "src/**" --fix
|
||||||
|
|
||||||
- name: Commit changes
|
- name: Commit changes
|
||||||
uses: EndBug/add-and-commit@v2.0.0
|
uses: EndBug/add-and-commit@v2.1.0
|
||||||
with:
|
with:
|
||||||
author_name: Your Name
|
author_name: Your Name
|
||||||
author_email: mail@example.com
|
author_email: mail@example.com
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ inputs:
|
|||||||
description: 'The email of the user that will be displayed as the author of the commit'
|
description: 'The email of the user that will be displayed as the author of the commit'
|
||||||
required: true
|
required: true
|
||||||
default: 'actions@github.com'
|
default: 'actions@github.com'
|
||||||
|
force:
|
||||||
|
description: 'Whether to use the force option on git add, in order to bypass eventual gitignores'
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
message:
|
message:
|
||||||
description: 'The message for the commit'
|
description: 'The message for the commit'
|
||||||
required: true
|
required: true
|
||||||
|
|||||||
@@ -19,7 +19,10 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
add() {
|
add() {
|
||||||
find $INPUT_PATH -name "$INPUT_PATTERN" | while read x; do git add $x; done
|
if $INPUT_FORCE
|
||||||
|
then find $INPUT_PATH -name "$INPUT_PATTERN" | while read x; do git add -f $x; done
|
||||||
|
else find $INPUT_PATH -name "$INPUT_PATTERN" | while read x; do git add $x; done
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# This is needed to make the check work for untracked files
|
# This is needed to make the check work for untracked files
|
||||||
|
|||||||
Reference in New Issue
Block a user