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
21 changes: 21 additions & 0 deletions .github/scripts/create-platform-release-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,27 @@ Platform: ${platform}"
echo "Version bump committed"
fi

# If the version bump branch has no commits ahead of main, skip pushing/PR creation
# Validate refs before computing ahead count to avoid masking errors
# Fail fast with a error message if the base branch doesn’t exist locally (or isn’t fetched)
# Verifies that ${main_branch} exists and resolves to a valid commit and not a tag, tree, or something else
if ! git rev-parse --verify --quiet "${main_branch}^{commit}" >/dev/null; then
echo "Error: Base branch does not resolve to a commit: ${main_branch}"
exit 1
fi
# Fail fast with a error message if the version bump branch doesn’t exist locally (or isn’t fetched)
# Verifies that ${version_bump_branch_name} exists and resolves to a valid commit and not a tag, tree, or something else
if ! git rev-parse --verify --quiet "${version_bump_branch_name}^{commit}" >/dev/null; then
echo "Error: Version bump branch does not resolve to a commit: ${version_bump_branch_name}"
exit 1
fi
# right-only count gives number of commits unique to the version bump branch
ahead_count=$(git rev-list --right-only --count "${main_branch}...${version_bump_branch_name}")
if [ "${ahead_count}" -eq 0 ]; then
echo "No differences between ${main_branch} and ${version_bump_branch_name}; skipping version bump PR creation."
return 0
fi

local version_bump_body="## Version Bump After Release

This PR bumps the ${main_branch} branch version from ${new_version} to ${next_version} after cutting the release branch.
Expand Down
Loading