diff --git a/.github/workflows/branch-checks.yml b/.github/workflows/branch-checks.yml index 5d6ac0d0fd..4599657ae3 100644 --- a/.github/workflows/branch-checks.yml +++ b/.github/workflows/branch-checks.yml @@ -649,9 +649,13 @@ jobs: - name: Reject changes to the Python SDK env: BASE_SHA: ${{ github.event.pull_request.base.sha }} + # Compare against the PR head, not the checked-out merge commit: the + # recorded base SHA can lag main, and diffing the merge commit would + # then report main's own changes as the PR's. + HEAD_SHA: ${{ github.event.pull_request.head.sha }} run: | set -euo pipefail - changed=$(git diff --name-only --diff-filter=d "${BASE_SHA}...HEAD" -- \ + changed=$(git diff --name-only --diff-filter=d "${BASE_SHA}...${HEAD_SHA}" -- \ python \ tasks/scripts/generate_python_proto.py) if [ -z "$changed" ]; then @@ -695,11 +699,13 @@ jobs: - name: Reject changes to the TypeScript SDK env: BASE_SHA: ${{ github.event.pull_request.base.sha }} + # See the Python SDK freeze: diff the PR head, not the merge commit. + HEAD_SHA: ${{ github.event.pull_request.head.sha }} run: | set -euo pipefail # The package is a stub that re-exports @ai-openshell/sdk. Its files stay # editable so the stub and its moved notice can be maintained. - changed=$(git diff --no-renames --name-only --diff-filter=d "${BASE_SHA}...HEAD" -- sdk/typescript \ + changed=$(git diff --no-renames --name-only --diff-filter=d "${BASE_SHA}...${HEAD_SHA}" -- sdk/typescript \ ':(exclude)sdk/typescript/package.json' \ ':(exclude)sdk/typescript/README.md' \ ':(exclude)sdk/typescript/index.js' \