fix(ci): pin release-notes baseline to the newest published v* release (#6445)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
James RichandClaude Fable 5 authored and GitHub committed 2026-07-26 10:44:00 -05:00
1 parent ec1606093e
commit e8fbaa6bcc
1 file changed
+27 -1
+27 -1
View File
@@ -555,13 +555,39 @@ jobs:
- name: Exclude flatpak-multisrc artifacts from release
run: rm -rf ./artifacts/flatpak-multisrc-*
# Generate the notes ourselves with an explicit previous tag. GitHub's automatic
# previous-release selection considers any published release, including the rolling
# "snapshot" prerelease that main-check.yml recreates on every push to main — when
# snapshot's commit is an ancestor of this tag it wins and the notes come out empty
# (see v2.8.0-open.3). Internal releases are drafts and invisible to the API's
# auto-selection, so pick the newest published v* release ourselves.
- name: Generate release notes
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
TAG: ${{ inputs.tag_name }}
TARGET: ${{ inputs.commit_sha || github.sha }}
run: |
# Fail the step if the listing itself fails — an empty PREV must only ever
# mean "no published v* release exists yet", never a swallowed API error,
# because empty PREV re-enables the automatic selection this step avoids.
PUBLISHED_TAGS=$(gh api "repos/${REPO}/releases" --paginate \
--jq '.[] | select(.draft == false) | .tag_name')
PREV=$(printf '%s\n' "$PUBLISHED_TAGS" | grep -E '^v[0-9]' | grep -Fxv "$TAG" | head -1 || true)
echo "Previous release tag: ${PREV:-<none — falling back to automatic selection>}"
gh api "repos/${REPO}/releases/generate-notes" \
-f tag_name="$TAG" \
-f target_commitish="$TARGET" \
${PREV:+-f previous_tag_name="$PREV"} \
--jq '.body' > release-notes.md
- name: Create or Update GitHub Release
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ inputs.tag_name }}
target_commitish: ${{ inputs.commit_sha || github.sha }}
name: ${{ inputs.tag_name }} (${{ needs.prepare-build-info.outputs.APP_VERSION_CODE }})
generate_release_notes: true
body_path: release-notes.md
files: ./artifacts/**/*
draft: true
prerelease: true