fix(release): address crossfire review feedback

Move PR body update before the git-diff early exit so the release PR
description always reflects the current commit list, even when
CHANGELOG.md is already up to date. Add git pull --rebase before push
to handle the unlikely case of a diverged PR branch.

Make the Buildkite trigger step non-blocking with continue-on-error,
capture the API response to log the build URL on success, and emit a
warning annotation on failure so engineers are alerted without blocking
the OSS release.
This commit is contained in:
Will Pfleger
2026-06-03 16:30:29 -04:00
parent 6c430a9f78
commit 01bfff21d0
2 changed files with 24 additions and 14 deletions

View File

@@ -62,11 +62,13 @@ jobs:
-f ref="v$VERSION"
- name: Trigger internal release build
id: buildkite
continue-on-error: true
env:
BUILDKITE_API_TOKEN: ${{ secrets.BUILDKITE_API_TOKEN }}
VERSION: ${{ env.version }}
run: |
curl -sf -X POST \
RESPONSE=$(curl -sf -X POST \
"https://api.buildkite.com/v2/organizations/runway/pipelines/sprout-releases/builds" \
-H "Authorization: Bearer ${BUILDKITE_API_TOKEN}" \
-H "Content-Type: application/json" \
@@ -80,5 +82,13 @@ jobs:
\"relay_url\": \"wss://sprout-oss.stage.blox.sqprod.co\",
\"publish_latest\": \"true\"
}
}"
}")
BUILD_URL=$(echo "$RESPONSE" | jq -r '.web_url // empty')
echo "build-url=$BUILD_URL" >> "$GITHUB_OUTPUT"
echo "::notice::Internal build started: $BUILD_URL"
- name: Warn on Buildkite trigger failure
if: steps.buildkite.outcome == 'failure'
run: |
echo "::warning::Failed to trigger internal Buildkite build. Trigger manually: https://buildkite.com/runway/sprout-releases"

View File

@@ -143,7 +143,16 @@ jobs:
mv "$TMPFILE" CHANGELOG.md
# Skip commit if nothing changed.
# Always update PR body to reflect current commit list.
if [[ -n "$LAST_TAG" ]]; then
PR_HEADER="### Changes since ${LAST_TAG}:"$'\n\n'"${NEW_ENTRIES}"
else
PR_HEADER="Initial release."
fi
PR_BODY="## Release v${VERSION}"$'\n\n'"${PR_HEADER}"$'\n\n'"**To release:** merge this PR. The tag and build will happen automatically."
gh pr edit "$PR_NUMBER" --body "$PR_BODY"
# Only commit and push if the changelog file actually changed.
if git diff --quiet CHANGELOG.md; then
echo "Changelog already up to date — nothing to commit"
exit 0
@@ -151,15 +160,6 @@ jobs:
git add CHANGELOG.md
git commit -m "chore(release): sync changelog for v${VERSION}"
git pull --rebase origin "version-bump/${VERSION}"
git push origin "HEAD:refs/heads/version-bump/${VERSION}"
# Update the PR body with the refreshed commit list.
if [[ -n "$LAST_TAG" ]]; then
PR_HEADER="### Changes since ${LAST_TAG}:"$'\n\n'"${NEW_ENTRIES}"
else
PR_HEADER="Initial release."
fi
PR_BODY="## Release v${VERSION}"$'\n\n'"${PR_HEADER}"$'\n\n'"**To release:** merge this PR. The tag and build will happen automatically."
gh pr edit "$PR_NUMBER" --body "$PR_BODY"
echo "Changelog synced and PR #${PR_NUMBER} body updated"
echo "Changelog synced for v${VERSION}"