diff --git a/.github/workflows/check-version-bump.yaml b/.github/workflows/check-version-bump.yaml index 3db4af42..016e7c8a 100644 --- a/.github/workflows/check-version-bump.yaml +++ b/.github/workflows/check-version-bump.yaml @@ -22,11 +22,12 @@ jobs: run: | BASE_SHA="${{ github.event.pull_request.base.sha }}" HEAD_SHA="${{ github.event.pull_request.head.sha }}" + MERGE_BASE=$(git merge-base "$BASE_SHA" "$HEAD_SHA") - CHANGED_FILES=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA") + CHANGED_FILES=$(git diff --name-only "$MERGE_BASE" "$HEAD_SHA") if echo "$CHANGED_FILES" | grep -qE "^src/.*\.(py|pyi|proto)$"; then - BASE_VERSION=$(git show "$BASE_SHA:pyproject.toml" | grep "^version = " | cut -d'"' -f2) + BASE_VERSION=$(git show "$MERGE_BASE:pyproject.toml" | grep "^version = " | cut -d'"' -f2) HEAD_VERSION=$(git show "$HEAD_SHA:pyproject.toml" | grep "^version = " | cut -d'"' -f2) if [ "$BASE_VERSION" = "$HEAD_VERSION" ]; then