Skip to content

Commit

Permalink
Create flag to disable globbing
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanzweifel committed Apr 10, 2021
1 parent f4f9aed commit be370ec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/bin/bash

set -eu
set -o noglob;

if "$INPUT_DISABLE_GLOBBING"; then
set -o noglob;
fi

_main() {
_switch_to_repository
Expand Down
2 changes: 2 additions & 0 deletions tests/git-auto-commit.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -422,6 +423,7 @@ git_auto_commit() {
# ---

INPUT_FILE_PATTERN="*.py"
INPUT_DISABLE_GLOBBING=true

run git_auto_commit

Expand Down

0 comments on commit be370ec

Please # to comment.