From be370eccae5f149a5d32e99eab65e1529881293c Mon Sep 17 00:00:00 2001 From: Stefan Zweifel Date: Sat, 10 Apr 2021 17:10:27 +0200 Subject: [PATCH] Create flag to disable globbing --- action.yml | 3 +++ entrypoint.sh | 5 ++++- tests/git-auto-commit.bats | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index adb0fdf..fe8246c 100644 --- a/action.yml +++ b/action.yml @@ -52,6 +52,9 @@ inputs: description: Skip the call to git-fetch. required: false default: false + disable_globbing: + description: Stop the shell from expanding filenames (https://www.gnu.org/software/bash/manual/html_node/Filename-Expansion.html) + default: false outputs: changes_detected: diff --git a/entrypoint.sh b/entrypoint.sh index f04a2fe..0a1139c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,7 +1,10 @@ #!/bin/bash set -eu -set -o noglob; + +if "$INPUT_DISABLE_GLOBBING"; then + set -o noglob; +fi _main() { _switch_to_repository diff --git a/tests/git-auto-commit.bats b/tests/git-auto-commit.bats index 4447d3e..41239ee 100644 --- a/tests/git-auto-commit.bats +++ b/tests/git-auto-commit.bats @@ -22,6 +22,7 @@ setup() { export INPUT_PUSH_OPTIONS="" export INPUT_SKIP_DIRTY_CHECK=false export INPUT_SKIP_FETCH=false + export INPUT_DISABLE_GLOBBING=false # Configure Git if [[ -z $(git config user.name) ]]; then @@ -422,6 +423,7 @@ git_auto_commit() { # --- INPUT_FILE_PATTERN="*.py" + INPUT_DISABLE_GLOBBING=true run git_auto_commit