From 209afd9c9b63f94366ee7eaf3e9af46146d7d85e Mon Sep 17 00:00:00 2001 From: ernestl Date: Fri, 22 Nov 2024 14:51:32 +0200 Subject: [PATCH] fix --- .github/workflows/go-channels.yaml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go-channels.yaml b/.github/workflows/go-channels.yaml index a7b1194efee..f32e2a9189e 100644 --- a/.github/workflows/go-channels.yaml +++ b/.github/workflows/go-channels.yaml @@ -97,20 +97,33 @@ jobs: echo "Successfully run go_version_from_channel. Go version: $output" # Do not add it latest channel if it is the same version as snapd build if [[ "$output" != "$go_version_snapd_build" ]]; then + echo "Adding latest go channel to list" go_channel_list+=("$channel") - fi + else + echo "Version duplicate detected, not adding latest go channel to list" + fi else echo "$output" exit 1 fi fi + echo "raw go channel list:" + for item in "${go_channel_list[@]}"; do + echo "$item" + done + # Remove duplicates and convert to JSON array - unique_channels=$(printf '%s\n' "${go_channels[@]}" | sort -u | jq -R . | jq -s .) + unique_go_channel_list=$(printf '%s\n' "${go_channels_list[@]}" | sort -u | jq -R . | jq -s .) + + echo "unique go channel list:" + for item in "${unique_go_channel_list[@]}"; do + echo "$item" + done # Output the list { echo 'go-channels<> $GITHUB_OUTPUT