paketo-buildpacks / github-config

Common repository configuration
Apache License 2.0
8 stars 12 forks source link

Publish-drafts action: fix edge case #942

Closed sophiewigmore closed 5 months ago

sophiewigmore commented 5 months ago

Fixes an edge case in the publish-drafts action: Old behaviour, resulting in occasional wrong sort order:

 gh api /repos/<REPO>/releases | jq -r '[.[] | select(.draft == true) | .tag_name] | sort'
[
  "v0.10.2",
  "v0.5.14",
  "v0.7.11",
  "v0.8.13",
  "v0.9.9"
]

New behaviour:

 ‣ gh api /repos/<REPO>/releases | jq -r '[.[] | select(.draft == true) | .tag_name] | map(ltrimstr("v")) | sort_by( split(".") | map(tonumber) )'
[
  "0.5.14",
  "0.7.11",
  "0.8.13",
  "0.9.9",
  "0.10.2"
]