Skip to content

Commit

Permalink
Improve test, don't fail when version hasn't been bumped
Browse files Browse the repository at this point in the history
  • Loading branch information
farshidz committed Jan 24, 2025
1 parent 4bb705d commit 5010d71
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/test_patches_merged.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Test Patches Merged

on:
pull_request:
branches:
- mainline
push:
branches:
- mainline
Expand Down Expand Up @@ -30,13 +33,20 @@ 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 }}")
# Try to fetch current version branch first
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

0 comments on commit 5010d71

Please sign in to comment.