From 5541edcec7693c45ab19db6ccf6e7e3241c6107a Mon Sep 17 00:00:00 2001 From: snomiao Date: Wed, 1 Oct 2025 23:17:47 +0000 Subject: [PATCH] [fix] Correct checkout ref for fork PRs in lint-and-format workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The workflow was using `github.event.pull_request.head.ref` which only contains the branch name (e.g., 'mpe/typoFixes'). For PRs from forks, this causes GitHub Actions to incorrectly look for that branch in the main repository instead of the fork. Changed to use `refs/pull/${{ github.event.pull_request.number }}/head` which correctly references the PR's merge ref that GitHub creates. This ensures the workflow checks out the right code for both fork and non-fork PRs. This issue was observed in PR #5880 where the workflow was fetching from Comfy-Org/ComfyUI_frontend instead of the contributor's fork. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/lint-and-format.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-and-format.yaml b/.github/workflows/lint-and-format.yaml index d9904b0e0..089b2ffce 100644 --- a/.github/workflows/lint-and-format.yaml +++ b/.github/workflows/lint-and-format.yaml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@v5 with: token: ${{ secrets.GITHUB_TOKEN }} - ref: ${{ github.event.pull_request.head.ref }} + ref: refs/pull/${{ github.event.pull_request.number }}/head fetch-depth: 0 - name: Install pnpm