Skip to content
Closed
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: 6 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,12 @@ jobs:
echo "Promoting ${BASELINE} to stable release; current HEAD is a descendant."
exit 0
fi
if ! git merge-base --is-ancestor "${BASELINE}" HEAD; then
echo "ERROR: ${BASELINE} is not an ancestor of HEAD; select a Previous Release tag from this branch."
exit 1
fi
count="$(git rev-list --count "${BASELINE}..HEAD")"
if [ "$count" -eq 0 ]; then
echo "ERROR: No new commits since ${BASELINE}; refusing to create a duplicate release."
# BASELINE may not be a true git ancestor of HEAD (e.g. it was squash-merged
# into this branch's history rather than true-merged), so ancestry can't be
# relied on here. Compare tree content instead: if HEAD's tree is identical to
# BASELINE's, there's nothing new to release.
if [ "$(git rev-parse "${BASELINE}^{tree}")" = "$(git rev-parse "HEAD^{tree}")" ]; then
echo "ERROR: No changes since ${BASELINE} (working tree is identical); refusing to create a duplicate release."
exit 1
fi

Expand Down
Loading