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 33d1ba6 commit fb80433
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/check-base-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ jobs:
- name: Check base branch
run: |
git fetch origin
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
COMMITS_BEHIND=$(git log --oneline origin/main ^HEAD)
if [ -n "$COMMITS_BEHIND" ]; then
echo "Your branch is behind the target branch. The following commits are missing:"
echo "$COMMITS_BEHIND"
else
echo "Your branch is up to date with the target branch."
fi

0 comments on commit fb80433

Please sign in to comment.