Last verified: 2026-02-20 · Source
Visual testing in GitHub Actions
Add screenshot capture to GitHub Actions workflows. Run visual regression testing on every pull request without browser installation.
GitHub Actions + Scrnpix Workflow
Capture screenshots in your CI workflow using curl:
curl "https://api.scrnpix.com/screenshot?url=https%3A%2F%2Fyour-preview-url.vercel.app&width=1920&height=1080&full_page=true" \ -H "X-KEY: your-api-key" \ -o pr-screenshot.png
GitHub Actions Response Handling
Handle API responses in your workflow steps:
| Status | Description |
|---|---|
| 200 OK | Success. Save to artifacts with actions/upload-artifact. Reference in PR comments. |
| 400 Bad Request | Invalid parameters. Use echo and workflow logs to debug curl commands. |
| 401 Unauthorized | API key error. Store in GitHub Secrets and access via ${{ secrets.API_KEY }}. |
| 408 Timeout | Page timeout. Ensure preview deployment is ready before screenshot step. |
| 5xx Server Error | Server error. Use retry action or shell retry loop in workflow. |
Key Features
PR Preview Screenshots
Capture screenshots of preview deployments on every PR. Attach to PR comments for visual review.
No Browser Setup
No need for Puppeteer or Playwright in CI. Just curl/wget to Scrnpix API. Faster workflows.
Artifacts Integration
Save screenshots as GitHub Actions artifacts. Download and review or use in subsequent jobs.
Matrix Testing
Use GitHub Actions matrix to capture screenshots at multiple resolutions in parallel.
Frequently Asked Questions
How do I add screenshots to GitHub Actions?
Use curl in a run step to call Scrnpix API. Save output to file and upload with actions/upload-artifact action.
Can I screenshot Vercel/Netlify previews?
Yes. Wait for deployment, extract preview URL, then capture with Scrnpix. Use deployment status actions to get URL.
How do I compare screenshots across PRs?
Store baselines in repository or artifacts. Download in workflow, capture new screenshot, compare with image diff tools.
Add screenshots to GitHub Actions
Capture visual regression baselines in your GitHub Actions workflows. No browser installation required.
Get Started