diff --git a/action.yml b/action.yml index adb0fdff..fe8246cf 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 f04a2fef..0a1139cb 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 4447d3eb..41239eee 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