Skip to content

Run safe CI for external contributors, add /deploy-preview slash command#201

Merged
southpolesteve merged 3 commits intomainfrom
ci/external-contributor-ci
Feb 28, 2026
Merged

Run safe CI for external contributors, add /deploy-preview slash command#201
southpolesteve merged 3 commits intomainfrom
ci/external-contributor-ci

Conversation

@southpolesteve
Copy link
Copy Markdown
Collaborator

@southpolesteve southpolesteve commented Feb 28, 2026

Summary

  • Skip deploy-examples.yml entirely for fork PRs via a job-level if condition. This is the main fix: no more noisy failed/skipped deploy checks on external contributor PRs.
  • Add a /deploy-preview slash command workflow (deploy-preview-command.yml) that lets maintainers trigger deploy previews on fork PRs. Gated by author_association (org members, collaborators, repo owners).
  • ci.yml is unchanged. It uses no secrets and runs for all PRs. First-time contributors need one manual approval, then subsequent PRs run automatically.
  • Cloudflare employees who push branches to the main repo continue to get automatic deploy previews via the existing deploy-examples.yml.
  • Document the CI setup in both AGENTS.md and README.md.

How it works

Contributor type Safe CI (lint, typecheck, tests) Deploy previews
Cloudflare employee (branch on main repo) Automatic Automatic
External contributor (fork, first PR) One-time approval Maintainer comments /deploy-preview
External contributor (fork, subsequent PRs) Automatic Maintainer comments /deploy-preview

Fork PRs don't have access to repository secrets (CLOUDFLARE_API_TOKEN,
CLOUDFLARE_ACCOUNT_ID), so deploy/smoke-test/comment steps always fail.
Add a fork detection condition to skip these steps gracefully. The build
steps still run, so example builds are still validated for fork PRs.
Switch ci.yml from pull_request to pull_request_target so lint, typecheck,
vitest, and e2e run automatically for fork PRs without needing approval.
No secrets are used, so this is safe with untrusted code.

Add a /deploy-preview slash command workflow that lets maintainers trigger
deploy previews on fork PRs. Gated by author_association (org members,
collaborators, repo owners only).

Cloudflare employees who push branches to the main repo continue to get
automatic deploy previews via the existing deploy-examples.yml workflow.
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Feb 28, 2026

Open in StackBlitz

npm i https://pkg.pr.new/vinext@201

commit: 1eb79c2

@github-actions
Copy link
Copy Markdown

Example Preview Production Original
app-router-cloudflare preview production
pages-router-cloudflare preview production
app-router-playground preview production original
realworld-api-rest preview production
nextra-docs-template preview production
benchmarks preview production
hackernews preview production original

Simpler approach: keep ci.yml on pull_request (first-time contributor
approval is fine, avoids cache poisoning concern with pull_request_target).

The actual fix: add a job-level if condition to deploy-examples.yml so the
entire workflow is skipped for fork PRs. This prevents the noisy
failed/skipped deploy checks on external contributor PRs.

Update docs in AGENTS.md and README.md to reflect the approach.
@southpolesteve southpolesteve merged commit 9a6c8a7 into main Feb 28, 2026
23 checks passed
@southpolesteve southpolesteve deleted the ci/external-contributor-ci branch February 28, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant