Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand file_pattern-input to an array #205

Merged
merged 12 commits into from Sep 17, 2022
8 changes: 6 additions & 2 deletions entrypoint.sh
Expand Up @@ -40,8 +40,11 @@ _git_is_dirty() {
echo "INPUT_STATUS_OPTIONS: ${INPUT_STATUS_OPTIONS}";
echo "::debug::Apply status options ${INPUT_STATUS_OPTIONS}";

echo "INPUT_FILE_PATTERN: ${INPUT_FILE_PATTERN}";
INPUT_FILE_PATTERN_ARRAY=( ${INPUT_FILE_PATTERN} )
stefanzweifel marked this conversation as resolved.
Show resolved Hide resolved

# shellcheck disable=SC2086
[ -n "$(git status -s $INPUT_STATUS_OPTIONS -- $INPUT_FILE_PATTERN)" ]
[ -n "$(git status -s $INPUT_STATUS_OPTIONS -- ${INPUT_FILE_PATTERN:+${INPUT_FILE_PATTERN_ARRAY[@]}})" ]
stefanzweifel marked this conversation as resolved.
Show resolved Hide resolved
}

_switch_to_branch() {
Expand Down Expand Up @@ -75,9 +78,10 @@ _add_files() {
echo "::debug::Apply add options ${INPUT_ADD_OPTIONS}";

echo "INPUT_FILE_PATTERN: ${INPUT_FILE_PATTERN}";
INPUT_FILE_PATTERN_ARRAY=( ${INPUT_FILE_PATTERN} )

# shellcheck disable=SC2086
git add ${INPUT_ADD_OPTIONS} ${INPUT_FILE_PATTERN};
git add ${INPUT_ADD_OPTIONS} ${INPUT_FILE_PATTERN:+"${INPUT_FILE_PATTERN_ARRAY[@]}"};
stefanzweifel marked this conversation as resolved.
Show resolved Hide resolved
}

_local_commit() {
Expand Down