Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions utils/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,14 @@ echo ""
print_info "Triggering GitHub Actions workflow..."
REQUEST_ID="release-$(date -u +%Y%m%dT%H%M%SZ)-$$-$RANDOM"

# In retry mode, don't pass source_sha — the branch HEAD may have moved since
# the original run, and the workflow rejects SHA mismatches.
if [ -n "$RETRY_RUN_ID" ]; then
SOURCE_SHA_FIELD=""
else
SOURCE_SHA_FIELD="--field source_sha=$COMMIT_SHA"
Comment on lines +651 to +654

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Pin retries to the current branch SHA

When retrying after the branch has moved, the confirmation still displays the original run's .headSha, but omitting this field makes GitHub resolve --ref to whatever the branch HEAD is at dispatch time. An unrelated push before dispatch can therefore cause a real retry to publish code the operator was never shown or asked to confirm. Resolve the current remote HEAD for retry mode, display it, and pass that value as source_sha so the workflow retains its mismatch guard.

Useful? React with 👍 / 👎.

fi

# Trigger the workflow
WORKFLOW_OUTPUT=$(mktemp)
WORKFLOW_ERROR=$(mktemp)
Expand All @@ -656,7 +664,7 @@ if gh workflow run release-validated.yml \
--field dry_run="$DRY_RUN" \
--field skip_tests="$SKIP_TESTS" \
--field request_id="$REQUEST_ID" \
--field source_sha="$COMMIT_SHA" > "$WORKFLOW_OUTPUT" 2> "$WORKFLOW_ERROR"; then
${SOURCE_SHA_FIELD:-} > "$WORKFLOW_OUTPUT" 2> "$WORKFLOW_ERROR"; then

WORKFLOW_SUCCESS=true
echo ""
Expand All @@ -673,8 +681,7 @@ if gh workflow run release-validated.yml \
| map(select(
(.display_title | contains(\"$REQUEST_ID\")) and
.actor.login == \"$ACTOR\" and
.head_branch == \"$BRANCH\" and
.head_sha == \"$COMMIT_SHA\"
.head_branch == \"$BRANCH\"
))
| if length == 1 then .[0].id else empty end")
if [ -n "$RUN_ID" ]; then
Expand Down
Loading