mirror of
https://github.com/tj-actions/changed-files
synced 2024-12-17 13:47:20 +00:00
Fixed bug with all_changed when array is empty (#46)
This commit is contained in:
parent
b25acb4ce7
commit
0e956bb09e
1 changed files with 6 additions and 6 deletions
12
action.yml
12
action.yml
|
@ -134,14 +134,14 @@ runs:
|
||||||
IFS=" " read -r -a SORTED_INPUT_FILES <<< "$(sort <<<"${ALL_INPUT_FILES[*]}")"
|
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[*]}")"
|
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
|
if [[ ${#SORTED_OUTPUT_ALL_MODIFIED_FILES[@]} -gt 0 ]]; then
|
||||||
echo "::set-output name=any_changed::true"
|
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
|
else
|
||||||
echo "::set-output name=any_changed::false"
|
echo "::set-output name=any_changed::false"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue