From c5737f1763cb6e46252bdac00871ca0ba6766d33 Mon Sep 17 00:00:00 2001 From: Craig Martin Date: Wed, 25 Nov 2026 08:16:03 -0500 Subject: [PATCH] Test the pushed pull request commit, not its branch's current tip Every tests-pr.yml checkout used the head branch name, so a job that waited for a runner tested whatever the branch pointed at when it started, and reported the result on the older commit. Check out the event's head SHA instead, for pull requests and merge groups alike. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/tests-pr.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests-pr.yml b/.github/workflows/tests-pr.yml index a13000e1c5b..c66b856c774 100644 --- a/.github/workflows/tests-pr.yml +++ b/.github/workflows/tests-pr.yml @@ -22,6 +22,8 @@ env: DEFAULT_NODE_VERSION: '26.12.1' PLAYWRIGHT_NODE_VERSION: '24.22.1' +# Each job checks out the commit the event names, not the branch's current tip, so a check reported +# on a commit always tested that commit, even if the branch moved while the job waited for a runner. jobs: type-check: name: 'Type check' @@ -31,7 +33,7 @@ jobs: - uses: actions/checkout@v6 with: repository: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }} - ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }} + ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} fetch-depth: 1 - name: Setup deps uses: ./.github/actions/setup-cli-deps @@ -48,7 +50,7 @@ jobs: - uses: actions/checkout@v6 with: repository: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }} - ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }} + ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} fetch-depth: 1 - name: Setup deps uses: ./.github/actions/setup-cli-deps @@ -65,7 +67,7 @@ jobs: - uses: actions/checkout@v6 with: repository: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }} - ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }} + ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} fetch-depth: 1 - name: Setup deps uses: ./.github/actions/setup-cli-deps @@ -84,7 +86,7 @@ jobs: - uses: actions/checkout@v6 with: repository: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }} - ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }} + ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} fetch-depth: 1 - name: Setup deps uses: ./.github/actions/setup-cli-deps @@ -105,7 +107,7 @@ jobs: - uses: actions/checkout@v6 with: repository: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }} - ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }} + ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} fetch-depth: 1 - name: Setup deps uses: ./.github/actions/setup-cli-deps @@ -128,7 +130,7 @@ jobs: - uses: actions/checkout@v6 with: repository: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }} - ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }} + ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} fetch-depth: 1 - name: Setup deps uses: ./.github/actions/setup-cli-deps @@ -199,7 +201,7 @@ jobs: - uses: actions/checkout@v6 with: repository: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }} - ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }} + ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} fetch-depth: 1 - name: Setup deps uses: ./.github/actions/setup-cli-deps @@ -232,7 +234,7 @@ jobs: - uses: actions/checkout@v6 with: repository: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }} - ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }} + ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} fetch-depth: 1 - name: Setup deps uses: ./.github/actions/setup-cli-deps @@ -270,7 +272,7 @@ jobs: - uses: actions/checkout@v6 with: repository: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }} - ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }} + ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} fetch-depth: 1 - name: Setup deps uses: ./.github/actions/setup-cli-deps @@ -359,7 +361,7 @@ jobs: - uses: actions/checkout@v6 with: repository: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }} - ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }} + ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} # Full history so `git merge-base origin/ HEAD` (used by # major-change-check.js) can reach the divergence point. fetch-depth: 0