Skip to content

Commit

Permalink
Fix fetching variants list (#3590)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ayoy authored Nov 22, 2024
1 parent fb7ff50 commit 56f4012
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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}]}"
Expand Down

0 comments on commit 56f4012

Please sign in to comment.