Skip to content

Commit

Permalink
Resolve bug with listing changed_files (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 committed Oct 14, 2021
1 parent 8190b1c commit bcb4e76
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ CHANGED_FILES=()
for path in ${INPUT_FILES}
do
echo "Checking for file changes: \"${path}\"..."
IFS=" " read -r -a ALL_CHANGED_FILES <<< "$(git diff --diff-filter=ACMUXTR --name-only | grep -E "(${path})" || true)"
# shellcheck disable=SC2207
CHANGED_FILES+=($(git diff --diff-filter=ACMUXTR --name-only | grep -E "(${path})" || true))
# Find unstaged changes
IFS=" " read -r -a UNSTAGED_FILES <<< "$(git status --porcelain | awk '{ print $2 }' | grep -E "(${path})" || true)"
CHANGED_FILES+=("${ALL_CHANGED_FILES[@]}" "${UNSTAGED_FILES[@]}")
# shellcheck disable=SC2207
CHANGED_FILES+=($(git status --porcelain | awk '{ print $2 }' | grep -E "(${path})" || true))
done

IFS=" " read -r -a UNIQUE_CHANGED_FILES <<< "$(echo "${CHANGED_FILES[@]}" | tr " " "\n" | sort -u | tr "\n" " ")"
Expand Down

0 comments on commit bcb4e76

Please sign in to comment.