Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
chrabyrd committed Apr 18, 2024
1 parent 2f67af8 commit 33d1ba6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/check-base-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@ jobs:
- name: Check base branch
run: |
git fetch origin
git merge-base --is-ancestor ${GITHUB_HEAD_REF} ${GITHUB_BASE_REF} || (echo "ERROR: The branch is not based off the latest version of the target branch." && exit 1)
BASE_BRANCH=$(git rev-parse origin/${{ github.event.pull_request.base.ref }})
CURRENT_BRANCH=$(git rev-parse HEAD)
if ! git merge-base --is-ancestor $BASE_BRANCH $CURRENT_BRANCH; then
echo "ERROR: The branch is not based off the latest version of the target branch."
exit 1
fi

0 comments on commit 33d1ba6

Please sign in to comment.