Skip to content

Commit

Permalink
Improve patches_merged test, don't fail when version hasn't been bump…
Browse files Browse the repository at this point in the history
…ed (#1104)
  • Loading branch information
farshidz authored Jan 28, 2025
1 parent 68652f4 commit 4ee1847
Showing 1 changed file with 13 additions and 5 deletions.
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
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 4ee1847

Please sign in to comment.