diff --git a/.github/workflows/lint-and-format.yaml b/.github/workflows/lint-and-format.yaml index 8b63fe0fc..abf90053c 100644 --- a/.github/workflows/lint-and-format.yaml +++ b/.github/workflows/lint-and-format.yaml @@ -15,7 +15,7 @@ jobs: - name: Checkout PR uses: actions/checkout@v5 with: - ref: ${{ github.head_ref }} + ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || github.ref }} - name: Install pnpm uses: pnpm/action-setup@v4 @@ -100,4 +100,4 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, body: '## ⚠️ Linting/Formatting Issues Found\n\nThis PR has linting or formatting issues that need to be fixed.\n\n**Since this PR is from a fork, auto-fix cannot be applied automatically.**\n\n### Option 1: Set up pre-commit hooks (recommended)\nRun this once to automatically format code on every commit:\n```bash\npnpm prepare\n```\n\n### Option 2: Fix manually\nRun these commands and push the changes:\n```bash\npnpm lint:fix\npnpm format\n```\n\nSee [CONTRIBUTING.md](https://github.com/Comfy-Org/ComfyUI_frontend/blob/main/CONTRIBUTING.md#git-pre-commit-hooks) for more details.' - }) \ No newline at end of file + })