-
Notifications
You must be signed in to change notification settings - Fork 226
Description
Problem
External contributors who open PRs from forks will always see a failing Vercel – posthog-nextjs-config CI check. Vercel deliberately withholds environment variables (like ENVIRONMENT_ID) from fork builds as a security measure to prevent secret exfiltration.
This creates a poor contributor experience:
- Contributor confusion — They see a red X and may think their code is broken, when it's actually a CI infrastructure limitation they can't fix
- Blocked merging — If the Vercel check is required in branch protection, the PR can't be merged even though all actual code quality checks pass
- Extra maintainer overhead — We have to manually re-push the branch to the main repo and open a new PR to get CI to pass
The call-flags-project / add-to-project-board check also fails on fork PRs due to GitHub permissions, adding to the noise.
Example
PR #2510 from @Tehnix had all code checks passing (tests, lint, TypeScript, Playwright, etc.) but couldn't be merged due to the Vercel check failing with:
Build error occurred
[Error: Environment ID not provided. If you are using turbo, make sure to add env variables to your turbo config]
We had to push the branch to the main repo and open #2975 to work around it.
Possible solutions
A few approaches other repos use — not mutually exclusive:
- Make the Vercel check non-required in branch protection rules. It still runs and shows a warning, but doesn't block merging.
- Use a "safe to test" label workflow — a maintainer reviews the fork PR, adds a label, and that triggers a re-run from the main repo context with secrets available.
- Document it — add a note in
CONTRIBUTING.mdexplaining that the Vercel preview check will fail on fork PRs and that's expected. - Split required vs informational checks — only mark code quality checks (tests, lint, build, TypeScript) as required. Keep Vercel and project board checks as optional/informational.
Option 4 is probably the least friction while keeping security intact. The Vercel preview is useful for review but shouldn't gate merging.