From fb804337d60ce061820a0d66e4164b27e801fce5 Mon Sep 17 00:00:00 2001 From: Christopher Byrd Date: Thu, 18 Apr 2024 13:41:48 -0700 Subject: [PATCH] nit --- .github/workflows/check-base-branch.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check-base-branch.yml b/.github/workflows/check-base-branch.yml index ea7c9c9..a91268f 100644 --- a/.github/workflows/check-base-branch.yml +++ b/.github/workflows/check-base-branch.yml @@ -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 \ No newline at end of file