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
16 changes: 13 additions & 3 deletions .github/workflows/release-qualification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,21 @@ jobs:
else
PR_JSON=$(gh api \
-H "Accept: application/vnd.github+json" \
"/repos/${GITHUB_REPOSITORY}/commits/${SOURCE_REF}/pulls" \
--jq '[.[] | select(.base.ref == "main")] | sort_by(.updated_at) | last')
"/repos/${GITHUB_REPOSITORY}/commits/${SOURCE_REF}/pulls" |
jq --arg source "$SOURCE_REF" \
'[.[] | select(.base.ref == "main" and .merge_commit_sha == $source)] | last')
HEAD_REPOSITORY=$(jq -r '.head.repo.full_name // empty' <<< "$PR_JSON")
HEAD_REF=$(jq -r '.head.ref // empty' <<< "$PR_JSON")
BASE_SHA=$(jq -r '.base.sha // empty' <<< "$PR_JSON")
MERGE_COMMIT_SHA=$(jq -r '.merge_commit_sha // empty' <<< "$PR_JSON")
if [ "$MERGE_COMMIT_SHA" != "$SOURCE_REF" ]; then
echo "::error::Workflow dispatch requalification requires the exact merged release commit"
exit 1
fi
Comment thread
greptile-apps[bot] marked this conversation as resolved.
# The PR's recorded base can be stale when another PR lands between
# qualification and merge. Compare the exact merged commit with its
# first parent so concurrent main changes are not misclassified as
# release-PR changes.
BASE_SHA=$(git rev-parse "${SOURCE_REF}^")
fi

CURRENT_VERSION=$(sed -n '/^\[workspace.package\]/,/^\[/s/^version = "\(.*\)"/\1/p' Cargo.toml)
Expand Down
Loading