Skip to content

Commit

Permalink
Fixed bug with all_changed when array is empty (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 authored May 1, 2021
1 parent b25acb4 commit 0e956bb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,14 @@ runs:
IFS=" " read -r -a SORTED_INPUT_FILES <<< "$(sort <<<"${ALL_INPUT_FILES[*]}")"
IFS=" " read -r -a SORTED_OUTPUT_ALL_MODIFIED_FILES <<< "$(sort <<<"${OUTPUT_ALL_MODIFIED_FILES[*]}")"
if [[ "${SORTED_INPUT_FILES[*]}" == "${SORTED_OUTPUT_ALL_MODIFIED_FILES[*]}" ]]; then
echo "::set-output name=all_changed::true"
else
echo "::set-output name=all_changed::false"
fi
if [[ ${#SORTED_OUTPUT_ALL_MODIFIED_FILES[@]} -gt 0 ]]; then
echo "::set-output name=any_changed::true"
if [[ "${SORTED_INPUT_FILES[*]}" == "${SORTED_OUTPUT_ALL_MODIFIED_FILES[*]}" ]]; then
echo "::set-output name=all_changed::true"
else
echo "::set-output name=all_changed::false"
fi
else
echo "::set-output name=any_changed::false"
fi
Expand Down

0 comments on commit 0e956bb

Please sign in to comment.