From 7f082ab42815bf2b96634ce41db12683aacc837f Mon Sep 17 00:00:00 2001 From: Federico Grandi Date: Wed, 18 Sep 2019 23:00:21 +0200 Subject: [PATCH] Add patterns --- README.md | 11 +++++++---- action.yml | 8 ++++++-- entrypoint.sh | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 73b9f61..b19aff9 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,13 @@ Add a step like this to your workflow: ```yaml - name: Commit changes # This is the step name that will be displayed in your runs - uses: EndBug/add-and-commit@latest # You can change this to use a specific version + uses: EndBug/add-and-commit@v2.0.0 # You can change this to use a specific version with: # See more info about inputs below author_name: Your Name author_email: mail@example.com message: "Your commit message" - path: ./*.js + path: "." + pattern: "*.js" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged ``` @@ -27,6 +28,7 @@ Add a step like this to your workflow: - `author_email` : the email of the user that will be displayed as the author of the commit - `message` : the message for the commit - `path` : the path(s) to stage files from +- `pattern` : the pattern that matches file names ### Environment variables: @@ -61,12 +63,13 @@ jobs: run: eslint "src/**" --fix - name: Commit changes - uses: EndBug/add-and-commit@latest + uses: EndBug/add-and-commit@v2.0.0 with: author_name: Your Name author_email: mail@example.com message: "Your commit message" - path: ./*.js + path: "." + pattern: "*.js" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ``` diff --git a/action.yml b/action.yml index 100673f..1205a00 100644 --- a/action.yml +++ b/action.yml @@ -17,8 +17,12 @@ inputs: path: description: 'The path to stage files from' required: true - default: './**/*.*' - + default: '.' + pattern: + description: 'The pattern that mathces file names' + required: false + default: "*.*" + runs: using: 'docker' image: 'Dockerfile' diff --git a/entrypoint.sh b/entrypoint.sh index a3c540c..dfe3fe5 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -19,7 +19,7 @@ EOF } add() { - find $INPUT_PATH -name "*.*" | while read x; do git add $x; done + find $INPUT_PATH -name $INPUT_PATTERN | while read x; do git add $x; done } # This is needed to make the check work for untracked files