Integrations/GitHub Actions
GitHub

Visual testing in every GitHub Actions workflow

Catch UI regressions on every pull request with automated screenshots

Add screenshot capture to your GitHub Actions CI/CD pipeline. Automatically capture screenshots of preview deployments on every PR, compare them against baselines, and catch visual regressions before they reach production.

How it works

Connect in 4 steps

1

Add workflow file

Create a .github/workflows/screenshots.yml file in your repository.

2

Store your API key

Add your Allscreenshots API key as a GitHub repository secret.

3

Capture on PR

Use curl in a workflow step to capture screenshots of your preview deployment.

4

Upload as artifacts

Store screenshots as GitHub Actions artifacts for review and comparison.

</> Code

GitHub Actions Workflow

yaml
1name: Visual Regression Tests
2on:
3  pull_request:
4    branches: [main]
5
6jobs:
7  screenshots:
8    runs-on: ubuntu-latest
9    steps:
10      - uses: actions/checkout@v4
11
12      - name: Capture Screenshots
13        run: |
14          curl -X POST 'https://api.allscreenshots.com/v1/screenshot' \
15            -H 'Authorization: Bearer ${{ secrets.SCREENSHOT_API_KEY }}' \
16            -H 'Content-Type: application/json' \
17            -d '{
18              "url": "https://preview-${{ github.event.number }}.yourapp.com",
19              "fullPage": true,
20              "viewport": { "width": 1920, "height": 1080 }
21            }' -o screenshot.png
22
23      - name: Upload Screenshot
24        uses: actions/upload-artifact@v4
25        with:
26          name: screenshots
27          path: screenshot.png
Why Allscreenshots

Built for GitHub Actions

No browser setup

Skip installing Puppeteer or Playwright in your CI. One API call captures any page.

Fast and reliable

Screenshots are captured on Allscreenshots' infrastructure, not your CI runner. No flaky browser tests.

PR-level visibility

Attach screenshots as artifacts to every PR for easy visual review.

FAQ

Frequently asked questions

Yes. Download the baseline screenshot from the main branch artifact and compare it with the PR screenshot using image diff tools in your workflow.

Ready to integrate with GitHub Actions?

Start with 100 free screenshots every month. No credit card required.