Improve RetroVERSE workflow previous metadata lookup

This commit is contained in:
icenine451 2026-11-05 10:45:49 -05:00
parent 4628783bd4
commit 0b680b7840

View file

@ -436,8 +436,10 @@ jobs:
echo "Looking for previous release on branch: ${BRANCH_NAME}"
PREV_RELEASE=$(gh release list --limit 100 --json tagName \
-q "[.[] | select(.tagName | startswith(\"${BRANCH_NAME}-\"))] | .[0].tagName")
# Newest published, non-draft release for this branch. Sorted by publishedAt:
# 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
echo "No previous release found for branch ${BRANCH_NAME}"