[fix] Correct checkout ref for fork PRs in lint-and-format workflow

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 <noreply@anthropic.com>
This commit is contained in:
snomiao
2025-10-01 23:17:47 +00:00
parent d76b1abc46
commit 5541edcec7

View File

@@ -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