File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -212,8 +212,12 @@ make_cli_entry() {
212212 shift 3
213213 local -a rust_versions=(" $@ " )
214214
215+ # Sort numerically so 1.100.0 lands AFTER 1.99.0; default jq `sort` on
216+ # strings would put "1.100.0" before "1.99.0" lexicographically.
215217 local rust_array
216- rust_array=" $( printf ' %s\n' " ${rust_versions[@]} " | jq -R . | jq -s ' sort' ) "
218+ rust_array=" $( printf ' %s\n' " ${rust_versions[@]} " \
219+ | jq -R . \
220+ | jq -s ' sort_by(split(".") | map(tonumber))' ) "
217221
218222 jq -n \
219223 --arg default_rust " $default_rust " \
@@ -238,8 +242,11 @@ pick_release_tag() {
238242 local cli_pat
239243 cli_pat=" $( printf ' %s' " $cli " | sed ' s/\./\\./g' ) "
240244
245+ # Let gh failures (auth, network, API outage) propagate — silently
246+ # treating them as "no releases" would suggest tag v<cli> even when one
247+ # really exists, leading to a confusing create-release link in the PR.
241248 local existing_tags
242- existing_tags=" $( gh release list --limit 200 --json tagName --jq ' .[].tagName' 2> /dev/null || true ) "
249+ existing_tags=" $( gh release list --limit 200 --json tagName --jq ' .[].tagName' ) "
243250
244251 if ! grep -qE " ^v${cli_pat} \$ " <<< " $existing_tags" ; then
245252 printf ' v%s\n' " $cli "
You can’t perform that action at this time.
0 commit comments