From c8861f238cfa38536ce28386bce8f9696d52e2fb Mon Sep 17 00:00:00 2001 From: Jayson Grace Date: Sat, 20 Jun 2026 10:04:54 -0600 Subject: [PATCH] ci: fix fork PR checkout in pre-commit workflow **Changed:** - Added `repository` input to the checkout step so fork PRs resolve the head branch from the fork's repo rather than the base repo, preventing checkout failures when the branch doesn't exist on the base repository --- .github/workflows/pre-commit.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index 6b4bf6a8..59ea9028 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -40,6 +40,10 @@ jobs: - name: Checkout git repository uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: + # For fork PRs the head branch only exists on the fork, so the + # repository must point at the fork or the checkout fails. Falls + # back to the base repo for non-pull_request events. + repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} ref: ${{ github.event.pull_request.head.ref || github.ref }} persist-credentials: false