From ab34b21df96c3a59e362afd320d5c467f6fa5347 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten-Lebbing Date: Sun, 3 Apr 2022 16:41:39 +0200 Subject: [PATCH] Update action.yaml --- .github/actions/collect-changes/action.yaml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/actions/collect-changes/action.yaml b/.github/actions/collect-changes/action.yaml index 589ad51e90a..fa6ca7cfb9c 100644 --- a/.github/actions/collect-changes/action.yaml +++ b/.github/actions/collect-changes/action.yaml @@ -97,22 +97,26 @@ runs: echo "Discovering changed charts since '$latest_tag'..." changed_charts=() readarray -t changed_charts <<< "$(lookup_changed_charts "$latest_tag")" - echo "Number of detected changed charts: ${#changed_charts[@]}" - if [ ${#changed_charts[@]} -eq 0 ] || [ ((${#changed_charts[@]})) ] || [ "${changed_charts[0]}" = "\" ]; then + + CHARTS=() + for CHARTPATH in "${changed_charts[@]}" + do + IFS='/' read -r -a path_parts <<< "${CHARTPATH}" + CHARTS+=("${path_parts[1]}/${path_parts[2]}") + done + + echo "Number of detected changed charts: ${#CHARTS[@]}" + if [ ${#CHARTS[@]} -eq 0 ] || [ "${CHARTS[0]}" = " " ] || [ "${CHARTS[0]}" = "/" ]; then echo "No Changed Charts detected since latest tag..." printf "::set-output name=changesDetectedAfterTag::%s\n" "false" else echo "Changed Charts detected since latest tag, parsing..." printf "::set-output name=changesDetectedAfterTag::%s\n" "true" - CHARTS=() + echo "Changed charts: ${changed_charts[*]}" # Get only the chart paths - for CHARTPATH in "${changed_charts[@]}" - do - IFS='/' read -r -a path_parts <<< "${CHARTPATH}" - CHARTS+=("${path_parts[1]}/${path_parts[2]}") - done + # Set output to changed charts echo "Changed charts with short paths: ${changed_charts[*]}" printf "::set-output name=modifiedChartsAfterTag::%s\n" "${CHARTS[*]}"