Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestl committed Nov 22, 2024
1 parent 3dfe799 commit 209afd9
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/go-channels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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<<EOF'
echo "$unique_channels"
echo "$unique_go_channel_list"
echo EOF
} >> $GITHUB_OUTPUT

0 comments on commit 209afd9

Please sign in to comment.