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 346d604 commit 8df8a99
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/check-base-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ jobs:
run: |
git fetch origin
CURRENT_BRANCH=$(echo "${{ github.ref }}" | cut -d'/' -f3)
CURRENT_BRANCH=$(echo "${{ github.ref }}" | sed 's|.*/||')
TARGET_BRANCH="${{ github.event.pull_request.base.ref }}"
echo $CURRENT_BRANCH
COMMON_ANCESTOR=$(git merge-base $CURRENT_BRANCH origin/$TARGET_BRANCH)
COMMITS_BEHIND=$(git rev-list --count origin/main ^$COMMON_ANCESTOR)
COMMITS_BEHIND=$(git log --oneline origin/$TARGET_BRANCH ^$CURRENT_BRANCH)
echo $COMMITS_BEHIND
if [ -n "$COMMITS_BEHIND" ]; then
echo "Your branch is behind the target branch. The following commits are missing:"
Expand Down

0 comments on commit 8df8a99

Please sign in to comment.