fix(ci): support fork PR workflows for community contributors#143
fix(ci): support fork PR workflows for community contributors#143
Conversation
📊 Test Coverage Report
Coverage measured by |
📦 PR Build Artifacts
|
Keith-CY
left a comment
There was a problem hiding this comment.
P1 - .github/workflows/screenshot.yml:3-27
This change fixes fork PR checkout, but it also breaks the existing workflow_dispatch entrypoint for the screenshot workflow. The workflow still declares workflow_dispatch, yet the checkout step now unconditionally reads github.event.pull_request.head.repo.full_name and github.event.pull_request.head.ref. Those fields do not exist on manual runs, so the very first step loses its repository/ref inputs and the manually triggered screenshot job stops working.
Please keep the PR-specific checkout for pull_request, but fall back to github.repository + the current ref for workflow_dispatch (or split the checkout into separate guarded steps) so manual screenshot runs continue to work.
📏 Metrics Gate ReportStatus: ✅ All gates passed Commit Size ✅
Bundle Size ✅
Perf Metrics E2E ✅
Command Perf (local) ✅
Local command timings
Command Perf (remote SSH) ✅
Remote command timings (via Docker SSH)
Home Page Render Probes (real IPC) ✅
Code Readability
|
📸 UI ScreenshotsCommit: Light Mode — Core Pages
Dark Mode
Responsive + Dialogs
|
…l contributors) - screenshot.yml: checkout from fork repo, skip push/comment for fork PRs - coverage.yml: skip PR comment for fork PRs (read-only GITHUB_TOKEN) - metrics.yml: skip PR comment for fork PRs (read-only GITHUB_TOKEN) Fork PRs still run all checks/builds/tests — only write-back steps (pushing refs, posting PR comments) are skipped since the fork token lacks write permissions.
- coverage.yml: save comment body as artifact for fork PR pickup - metrics.yml: save comment body as artifact for fork PR pickup - fork-pr-comment.yml: new workflow_run handler that downloads comment artifacts and posts them with write permissions Same-repo PRs still post comments directly (no change). Fork PRs now get full metrics/coverage visibility via the workflow_run relay.
Download step uses continue-on-error so the workflow doesn't fail when the upstream workflow failed before producing the comment artifact. Subsequent steps gated on download success.
23dff3d to
242e262
Compare
…enshot.yml When triggered via workflow_dispatch, pull_request context fields are empty. Use '|| github.repository' and '|| github.ref' fallbacks so manual runs still check out the correct code. Addresses Keith-CY's review feedback on PR #143.

























Problem
When a community contributor opens a PR from a fork (e.g.
zzhengzhuo015/clawpal→lay2dev/clawpal), 3 CI workflows fail:actions/checkoutusesgithub.head_refwhich doesn't exist in the base repopeter-evans/create-or-update-commentfails because fork PRs get a read-onlyGITHUB_TOKENFix
github.event.pull_request.head.repo.full_name+ skip push/comment steps for fork PRsAll checks, builds, and tests still run for fork PRs — only write-back steps (pushing screenshot refs, posting PR comments) are skipped since the fork token lacks write permissions.
Context
Triggered by PR #142 (
feat: remote doctorby @zzhengzhuo015) which had 3 CI failures due to being a fork contribution.