Skip to content

Commit fb0522d

Browse files
benceruleanluchristian-byrne
authored andcommitted
ci: fork-safe checkout for lint workflow (#5887)
Use conditional ref to support forks and avoid checkout failures. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5887-ci-fork-safe-checkout-for-lint-workflow-2806d73d36508139b9effa6d18e1cadb) by [Unito](https://www.unito.io)
1 parent 355307d commit fb0522d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/lint-and-format.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Checkout PR
1616
uses: actions/checkout@v5
1717
with:
18-
ref: ${{ github.head_ref }}
18+
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || github.ref }}
1919

2020
- name: Install pnpm
2121
uses: pnpm/action-setup@v4
@@ -100,4 +100,4 @@ jobs:
100100
owner: context.repo.owner,
101101
repo: context.repo.repo,
102102
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.'
103-
})
103+
})

0 commit comments

Comments
 (0)