From 0e956bb09e9b05df440a2459a041cdec3cc0cc0c Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sat, 1 May 2021 16:35:48 -0400 Subject: [PATCH] Fixed bug with all_changed when array is empty (#46) --- action.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index 69bb2d5d..7778e3a6 100644 --- a/action.yml +++ b/action.yml @@ -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