Struggling here to get my playwright E2E tests to run during GitHub Actions with Vercel’s Protection Bypass Automation.
1: GitHub is Mono Repo with 4 deployments (devSite1, devSite2, prodSite1, prodSite2
2: Vercel deployments are automatic default config, on every push, pr, merge, etc. and I have not disabled those to use GitHub actions for builds and deploys.
3: I don’t want preview urls (or any non-prod urls) exposed to the public, so Vercel Deployment Protections is enabled.
Now here is where I am stuck, Vercel Docs say 2 things:
Use protection-bypass-automation for e2e bypass, (and the example config is even for Playwright. → Protection Bypass for Automation
But Vercel System Environment Variables are not available to GitHub actions, so I can’t reference the VERCEL_AUTOMATION_BYPASS_SECRET in my GitHub actions YAML or my playwright.config.ts file.
So here’s my ask:
What am I doing wrong to implement the VERCEL_AUTOMATION_BYPASS_SECRET as described, or are the docs incomplete for usage with GitHub Actions?
Run tests on every successful Vercel deployment (including previews)
Use the Protection Bypass Automation secret in your tests
Keep your preview URLs protected while allowing automated tests
Important notes:
1. The workflow is triggered on deployment_status events, ensuring tests run after each Vercel deployment. 2. The VERCEL_TOKEN is required for using the Vercel CLI in the workflow. Add this to your GitHub secrets, obtaining it from your Vercel account settings. 3. For monorepo setups with multiple deployments, you may need additional logic in your workflow to determine which tests to run based on the deployed project. 4. The VERCEL_AUTOMATION_BYPASS_SECRET is project-specific. If you have multiple Vercel projects, you’ll need to manage multiple secrets. 5. Using the Vercel CLI to get the latest deployment URL is more reliable than relying on GitHub event data, especially for complex deployment scenarios.