Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve patches_merged test, don't fail when version hasn't been bumped #1104

Merged
merged 5 commits into from
Jan 28, 2025
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
18 changes: 13 additions & 5 deletions .github/workflows/test_patches_merged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,21 @@ jobs:

- name: Verify fast-forward merge possible
run: |
git fetch origin "releases/${{ steps.version.outputs.prev_minor }}"
MERGE_BASE=$(git merge-base origin/mainline "origin/releases/${{ steps.version.outputs.prev_minor }}")
RELEASE_HEAD=$(git rev-parse "origin/releases/${{ steps.version.outputs.prev_minor }}")
set -x
# Try to fetch current version branch first
wanliAlex marked this conversation as resolved.
Show resolved Hide resolved
if git fetch origin "releases/${{ steps.version.outputs.current_version }}" 2>/dev/null; then
BRANCH_TO_CHECK="releases/${{ steps.version.outputs.current_version }}"
else
BRANCH_TO_CHECK="releases/${{ steps.version.outputs.prev_minor }}"
git fetch origin "$BRANCH_TO_CHECK"
fi

MERGE_BASE=$(git merge-base origin/mainline "origin/$BRANCH_TO_CHECK")
RELEASE_HEAD=$(git rev-parse "origin/$BRANCH_TO_CHECK")

if [ "$MERGE_BASE" = "$RELEASE_HEAD" ]; then
echo "✅ Release branch is fast-forward mergeable into mainline"
echo "✅ Release branch $BRANCH_TO_CHECK is fast-forward mergeable into mainline"
else
echo "❌ Release branch is not fast-forward mergeable into mainline"
echo "❌ Release branch $BRANCH_TO_CHECK is not fast-forward mergeable into mainline"
exit 1
fi
Loading