From eec5771ea15eb15166ed1e63ce041abdb7d385e8 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 16 Feb 2026 02:51:34 +0000 Subject: [PATCH] ci: fix checkout for PRs from forks Use head repo and SHA when checking out pull_request events so the workflow can fetch the branch from the fork instead of the base repo. Fixes CI failure when patch-1 (or other fork branches) don't exist in the base repository. Co-authored-by: Ali Khokhar --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8d70d4d4..af313c7c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,8 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ${{ github.head_ref || github.ref_name }} + ref: ${{ github.event.pull_request.head.sha || github.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} fetch-depth: 1 - name: "Fail on type: ignore (no suppressions allowed)"