Skip to content

Commit a34577c

Browse files
committed
Add force option
1 parent 04cd48b commit a34577c

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Add a step like this to your workflow:
1818
message: "Your commit message"
1919
path: "."
2020
pattern: "*.js"
21+
force: false
2122
env:
2223
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged
2324
```
@@ -29,6 +30,7 @@ Add a step like this to your workflow:
2930
- `message` : the message for the commit
3031
- `path` : the path(s) to stage files from
3132
- `pattern` : the pattern that matches file names
33+
- `force` : whether to use the force option on git add, in order to bypass eventual gitignores
3234

3335
### Environment variables:
3436

@@ -63,7 +65,7 @@ jobs:
6365
run: eslint "src/**" --fix
6466
6567
- name: Commit changes
66-
uses: EndBug/[email protected].0
68+
uses: EndBug/[email protected].1
6769
with:
6870
author_name: Your Name
6971
author_email: [email protected]

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ inputs:
1010
description: 'The email of the user that will be displayed as the author of the commit'
1111
required: true
1212
default: '[email protected]'
13+
force:
14+
description: 'Whether to use the force option on git add, in order to bypass eventual gitignores'
15+
required: false
16+
default: false
1317
message:
1418
description: 'The message for the commit'
1519
required: true

entrypoint.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ EOF
1919
}
2020

2121
add() {
22-
find $INPUT_PATH -name "$INPUT_PATTERN" | while read x; do git add $x; done
22+
if $INPUT_FORCE find $INPUT_PATH -name "$INPUT_PATTERN" | while read x; do git add -f $x; done
23+
else find $INPUT_PATH -name "$INPUT_PATTERN" | while read x; do git add $x; done
2324
}
2425

2526
# This is needed to make the check work for untracked files

0 commit comments

Comments
 (0)