Skip to content

Commit 2de9910

Browse files
authored
Merge pull request #2 from EndBug/better-paths
Add patterns
2 parents 782b6b1 + 7f082ab commit 2de9910

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ Add a step like this to your workflow:
1111

1212
```yaml
1313
- name: Commit changes # This is the step name that will be displayed in your runs
14-
uses: EndBug/add-and-commit@latest # You can change this to use a specific version
14+
uses: EndBug/add-and-commit@v2.0.0 # You can change this to use a specific version
1515
with: # See more info about inputs below
1616
author_name: Your Name
1717
author_email: [email protected]
1818
message: "Your commit message"
19-
path: ./*.js
19+
path: "."
20+
pattern: "*.js"
2021
env:
2122
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged
2223
```
@@ -27,6 +28,7 @@ Add a step like this to your workflow:
2728
- `author_email` : the email of the user that will be displayed as the author of the commit
2829
- `message` : the message for the commit
2930
- `path` : the path(s) to stage files from
31+
- `pattern` : the pattern that matches file names
3032

3133
### Environment variables:
3234

@@ -61,12 +63,13 @@ jobs:
6163
run: eslint "src/**" --fix
6264
6365
- name: Commit changes
64-
uses: EndBug/add-and-commit@latest
66+
uses: EndBug/add-and-commit@v2.0.0
6567
with:
6668
author_name: Your Name
6769
author_email: [email protected]
6870
message: "Your commit message"
69-
path: ./*.js
71+
path: "."
72+
pattern: "*.js"
7073
env:
7174
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7275
```

action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ inputs:
1717
path:
1818
description: 'The path to stage files from'
1919
required: true
20-
default: './**/*.*'
21-
20+
default: '.'
21+
pattern:
22+
description: 'The pattern that mathces file names'
23+
required: false
24+
default: "*.*"
25+
2226
runs:
2327
using: 'docker'
2428
image: 'Dockerfile'

entrypoint.sh

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

2121
add() {
22-
find $INPUT_PATH -name "*.*" | while read x; do git add $x; done
22+
find $INPUT_PATH -name $INPUT_PATTERN | while read x; do git add $x; done
2323
}
2424

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

0 commit comments

Comments
 (0)