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