From 58ecc163933972c68661b629ef9841fc4ab4692c Mon Sep 17 00:00:00 2001 From: Federico Grandi Date: Wed, 18 Sep 2019 22:30:30 +0200 Subject: [PATCH 1/3] Allow multiple paths --- entrypoint.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index fb5a59964..dad9ac935 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,7 +2,7 @@ set -eu # Set up .netrc file with GitHub credentials -git_setup ( ) { +git_setup() { cat <<- EOF > $HOME/.netrc machine github.com login $GITHUB_ACTOR @@ -18,9 +18,13 @@ EOF git config --global user.name "Add & Commit GitHub Action" } +add() { + find $INPUT_PATH -name *.* | while read x; do git add $x; done +} + # This is needed to make the check work for untracked files echo "Staging files in commit path..." -git add "${INPUT_PATH}" +add echo "Checking for uncommitted changes in the git working tree..." # This section only runs if there have been file changes @@ -36,7 +40,7 @@ then git checkout "${GITHUB_REF:11}" echo "Adding files..." - git add "${INPUT_PATH}" + add echo "Creating commit..." git commit -m "$INPUT_MESSAGE" --author="$INPUT_AUTHOR_NAME <$INPUT_AUTHOR_EMAIL>" From bac719afe5492c73b9530f2f08edc36eb7fbcfdc Mon Sep 17 00:00:00 2001 From: Federico Grandi Date: Wed, 18 Sep 2019 22:34:38 +0200 Subject: [PATCH 2/3] Use quotes --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index dad9ac935..a3c540c95 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 "*.*" | while read x; do git add $x; done } # This is needed to make the check work for untracked files From 6a097ea13dd19a15c506e996c983732e618b04ca Mon Sep 17 00:00:00 2001 From: Federico Grandi Date: Wed, 18 Sep 2019 22:50:09 +0200 Subject: [PATCH 3/3] Little tweak to README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4fa420c04..73b9f61ff 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Add a step like this to your workflow: - `author_name` : the name of the user that will be displayed as the author of the commit - `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 to stage files from +- `path` : the path(s) to stage files from ### Environment variables: