More previous metadata lookup improvements

This commit is contained in:
icenine451 2026-11-05 10:46:37 -05:00
parent 0b680b7840
commit a2a6cbc10d

View file

@ -825,8 +825,10 @@ jobs:
echo "Reusing $ITEM from previous release" echo "Reusing $ITEM from previous release"
PREV_RELEASE=$(gh release list --limit 100 --json tagName \ # Newest published, non-draft release for this branch. Sorted by publishedAt:
-q "[.[] | select(.tagName | startswith(\"${BRANCH_NAME}-\"))] | .[0].tagName") # createdAt is unreliable after bulk migrations.
PREV_RELEASE=$(gh release list --limit 100 --json tagName,publishedAt,isDraft \
-q "[.[] | select((.isDraft | not) and (.tagName | startswith(\"${BRANCH_NAME}-\")))] | sort_by(.publishedAt) | last | .tagName")
if [[ -z "$PREV_RELEASE" || "$PREV_RELEASE" == "null" ]]; then if [[ -z "$PREV_RELEASE" || "$PREV_RELEASE" == "null" ]]; then
echo "ERROR: No previous release found but can_reuse is true" echo "ERROR: No previous release found but can_reuse is true"