From 56f40122bdb72eeb2db3a9317b0faacf5051a4b8 Mon Sep 17 00:00:00 2001 From: Dominik Kapusta Date: Fri, 22 Nov 2024 19:58:27 +0100 Subject: [PATCH] Fix fetching variants list (#3590) Task/Issue URL: https://app.asana.com/0/1203301625297703/1208823340768320/f Description: This change updates get_build_variants_list.sh to report all variants. origin_variants and variants_list are both bash arrays and when outputting them they need to be treated in a special way to avoid outputting only the first item. --- .../get_build_variants_list.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/actions/asana-get-build-variants-list/get_build_variants_list.sh b/.github/actions/asana-get-build-variants-list/get_build_variants_list.sh index a42d54ac58..d9308dc0d4 100755 --- a/.github/actions/asana-get-build-variants-list/get_build_variants_list.sh +++ b/.github/actions/asana-get-build-variants-list/get_build_variants_list.sh @@ -56,7 +56,7 @@ _fetch_origin_tasks() { fi done - echo "${origin_variants}" + echo "${origin_variants[*]}" | tr ' ' ',' } # Create a JSON string from the list of ATB items passed. @@ -92,14 +92,16 @@ _fetch_atb_variants() { variants_list=("$(_create_atb_variant_pairs "$atb_variants")") - echo "${variants_list}" + echo "${variants_list[*]}" | tr ' ' ',' } main() { + local atb_variants + local origin_variants # fetch ATB variants - local atb_variants=$(_fetch_atb_variants) + atb_variants="$(_fetch_atb_variants)" # fetch Origin variants - local origin_variants=$(_fetch_origin_tasks) + origin_variants="$(_fetch_origin_tasks)" # merges the two list together. Use `include` keyword for later usage in matrix. # for more info see https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#example-adding-configurations. local merged_variants="{\"include\": [${atb_variants},${origin_variants}]}"