Skip to main content
Browse documentation

Pull Request Regression Checks

A pull request regression check scans the preview deployment of a pull request, scans a baseline of the same pages, and reports the issues the change adds. Results appear as an A11y Pulse check on the pull request and as a comment listing each new issue, with links to the full report.

Contents:

How a check works

When a pull request is opened, reopened, or receives a new commit, A11y Pulse adds an in-progress A11y Pulse check to the head commit and waits for its preview deployment. Once the preview is live, A11y Pulse scans it and a baseline, then compares the two. The baseline is the first of these that exists:

  1. The deployment of the commit the pull request branched from.
  2. The latest deployment of the base branch.
  3. The site’s production URL.

The check reports issues as new (on the preview only), fixed (on the baseline only), or unchanged, plus any results that need a manual review. The pull request gets one comment, which is edited with the latest result after each push instead of a new comment being added.

A new commit cancels the check for the previous commit, and closing the pull request cancels any check still running.

By default a check never fails: it reports new issues and completes as neutral. Set fail_on to fail the check when a change adds an issue of a given impact or higher, then make the check required in your branch protection rules to block merging.

A check that can’t produce a result, for example because no preview appeared or the config is invalid, completes as neutral with the reason in its summary. GitHub treats a neutral check as passing, so it won’t block a merge.

Installing the GitHub App

You need permission to manage integrations in your A11y Pulse team.

  1. Open the GitHub integration settings in A11y Pulse and click Connect GitHub.
  2. On GitHub, choose the account or organization and the repositories to install the app on.
  3. Back in A11y Pulse, choose a site for each repository and click Save.

Each repository is checked against the site you chose. A repository with no site, and no site in its .a11ypulse.yml, gets no checks.

Preview hosts

A11y Pulse finds the preview from the events your host already sends to GitHub, so Vercel and Netlify need no configuration beyond the site mapping.

If no preview appears within wait_for_preview_minutes (15 minutes by default), the check completes as neutral with the title “No preview deployment found”.

Vercel

A11y Pulse watches GitHub deployment statuses and starts the check when a deployment in an environment whose name starts with Preview succeeds. It only uses deployments and statuses that Vercel’s own app created. This includes monorepo projects, which Vercel deploys to environments named after each project. If the preview finished deploying before the check was created, A11y Pulse looks it up from the commit’s deployments.

Netlify

A11y Pulse starts the check when Netlify’s deploy-preview commit status for the head commit succeeds, and scans the URL that status links to.

Cloudflare Workers and Pages

A11y Pulse starts the check when Cloudflare’s check run on the head commit succeeds, and scans the preview URL listed in that check run. Workers Builds lists one for every build, so a Workers project needs no extra setup. A11y Pulse only acts on a check run that GitHub attributes to Cloudflare’s own app, and only scans a listed URL on a workers.dev or pages.dev address.

If Cloudflare’s check run doesn’t list a preview URL, or you want to scan a different address, set preview_url. It takes precedence over the listed URL. For Cloudflare Pages, use your project’s branch alias URL:

preview_url: https://{branch}.my-project.pages.dev

{branch} is replaced with the branch alias Cloudflare Pages uses: the branch name in lowercase, with each run of characters other than letters and numbers replaced by a hyphen, cut to 28 characters, and with leading and trailing hyphens removed.

Cloudflare Pages doesn’t build previews for pull requests from forks, so checks with a pages.dev template complete as neutral on those pull requests.

Other hosts

For any other host, or to control exactly when a check runs, trigger the check from your pipeline instead.

Triggering a check from your pipeline

The a11y-pulse/regression-check-action GitHub Action starts a check through the A11y Pulse API, waits for it to finish, and writes a table of new issues to the job summary. It works with any host, because you pass the preview and baseline URLs yourself.

name: Accessibility regression check
on:
  deployment_status:

jobs:
  regression-check:
    if: github.event.deployment_status.state == 'success'
    runs-on: ubuntu-latest
    steps:
      - uses: a11y-pulse/regression-check-action@v1
        with:
          api-key: ${{ secrets.A11Y_PULSE_API_KEY }}
          site-id: your-site-id
          head-url: ${{ github.event.deployment_status.environment_url }}
          base-url: https://www.example.com

The action needs an API key with both the Trigger scans and Read access permissions. Store it as a repository secret. The site ID is the ID in the site’s URL in A11y Pulse.

Input Required Default Description
api-key Yes Your A11y Pulse API key, passed from secrets.
site-id Yes The site to check.
head-url Yes The preview URL.
base-url Yes The baseline URL to compare against.
paths No The site’s monitored pages Paths to check, one per line.
base-ref No The pull request’s base commit Git ref or SHA of the baseline.
fail-on No serious The lowest impact that fails the job. Takes the same values as fail_on.
timeout-minutes No 10 How long to wait for the check before failing the job.

The job fails when the check fails, ends with an error, or doesn’t finish within timeout-minutes. A cancelled or timed-out check ends the job with a notice and doesn’t fail it. The action sets two outputs: conclusion (success, failure, or neutral) and report-url.

A check started this way doesn’t read .a11ypulse.yml, so its settings come from the action’s inputs, and the default ignores don’t apply. It also never sends preview credentials, because A11y Pulse can’t tell whether the pull request behind it comes from a fork.

The .a11ypulse.yml file

Add a .a11ypulse.yml file to the root of your repository to configure the GitHub App’s checks. Every key is optional, and a repository without the file uses the defaults.

site: "a1b2c3d4"
fail_on: serious
pages:
  - /
  - /pricing
  - /contact
wait_for_preview_minutes: 20
ignore:
  - selector: "#intercom-container"
  - selector: ".promo-banner"

A11y Pulse reads the file from the pull request’s base branch, not from the pull request itself. A pull request that changes the file is checked with the base branch’s version until it merges. This means a contributor can’t use a pull request to send your preview credentials to another server or to loosen the rules that gate it.

If the file can’t be used, the check completes as neutral and its summary explains the problem, for example `.a11ypulse.yml` is invalid: `fail_on` must be one of critical, serious, moderate, any or never. Unknown keys are errors too.

site

The ID of the site to check the pull request against, in place of the site chosen in the GitHub integration settings. It must be a site in the team that installed the GitHub App. Quote the ID if it contains only digits, since YAML otherwise reads it as a number and the config is rejected.

A repository that deploys several previews, such as a monorepo, can map each Vercel deployment environment to its own site:

site:
  "Preview – marketing": "a1b2c3d4"
  "Preview – docs": "e5f6g7h8"

Each site gets its own check, named A11y Pulse (site name). Copy each environment name exactly as it appears in the pull request’s deployments on GitHub. A check mapped to an environment starts only from that environment’s deployment statuses, so this form works with Vercel but not with Netlify or Cloudflare.

fail_on

The lowest impact of new issue that fails the check. One of:

Value The check fails when the change adds
never (default) Nothing. The check always reports and completes as neutral.
critical A critical issue.
serious A serious or critical issue.
moderate A moderate, serious, or critical issue.
any Any issue.

Unchanged and fixed issues never fail a check.

pages

A list of paths to check, each starting with /. Each path must be a page A11y Pulse monitors for the site. Paths that aren’t monitored are listed as skipped in the comment, and if none of them are monitored, the check completes as neutral. At most 25 paths are checked, and any after the 25th are listed as skipped.

Without pages, the check scans the site’s monitored pages, up to 25, in alphabetical order of URL.

preview_url

A template for the preview URL, which must start with http:// or https://. A11y Pulse uses it when Cloudflare’s check run reports a successful build, in place of any preview URL the check run lists (see Cloudflare Workers and Pages). It has no effect on other hosts, so trigger the check from your pipeline instead. The template can contain:

  • {branch}: the head branch, as a Cloudflare Pages branch alias.
  • {pr}: the pull request number.
  • {sha7}: the first seven characters of the head commit’s SHA.

ignore

A list of CSS selectors. Issues inside an element matching any selector are hidden from the check, on both the preview and the baseline. Your site’s own ignore rules also apply.

ignore:
  - selector: "#cookie-banner"
  - selector: "[data-testid='chat-launcher']"

A selector that isn’t valid CSS is a config error. Without ignore, checks hide the containers of these common chat and consent widgets, which load third-party code you don’t control:

  • Intercom: #intercom-container, .intercom-lightweight-app
  • Drift: #drift-widget-container, #drift-iframe
  • HubSpot: #hubspot-messages-iframe-container, #hubspot-conversations-inline-parent
  • Zendesk: iframe#launcher, iframe#webWidget
  • OneTrust: #onetrust-consent-sdk
  • Cookiebot: #CybotCookiebotDialog
  • Osano: .osano-cm-window

Setting ignore replaces this list rather than adding to it. To keep a default, include its selector in your list. To check these widgets too, set ignore: [].

wait_for_preview_minutes

How long to wait for a preview deployment before the check completes as neutral. Defaults to 15. Values are rounded to whole minutes and kept between 1 and 60.

Protected previews

If your previews need credentials, open the site’s settings in A11y Pulse and choose one under Preview protection:

  • Vercel: your project’s Protection Bypass for Automation secret.
  • Cloudflare Access: a service token’s client ID and client secret.
  • Basic auth: a username and password.

Secret values come from your team’s secrets, so create those first.

A11y Pulse sends these credentials only to the preview’s own origin, and only for GitHub App checks on pull requests from branches in the same repository. When the baseline is a deployment from the same host (the merge base’s or the base branch’s), its scan gets them too, sent only to the baseline’s origin. A production baseline never does. Checks triggered from the GitHub Action or the API never send them.

A page that answers with a 401 or 403 is listed as skipped, with “the preview returned an authentication error”, and isn’t compared.

Netlify’s password protection can’t be unlocked this way. To scan a password-protected Netlify preview, log in with a launch script instead.

A launch script that uses secret() runs only where the credentials above would be sent. For a pull request from a fork, or a check from the GitHub Action or the API, the check completes as neutral with “Launch scripts that use secrets are not run for pull requests from forks or for API checks.” A launch script without secrets runs as usual.

Pull requests from forks

Anyone can open a pull request from a fork, so A11y Pulse treats fork pull requests with more caution:

  • If the site has preview protection set up, the check completes as neutral with “Protected previews are not scanned for pull requests from forks.” The credentials are never sent.
  • If the site’s launch script uses secrets, the check completes as neutral and the script doesn’t run.
  • On Cloudflare Pages with a pages.dev preview_url, the check completes as neutral, because Cloudflare Pages doesn’t build fork previews.
  • On other hosts, the check runs as usual if the host builds a public preview for the fork.

Re-running a check

Click Re-run on the A11y Pulse check in GitHub to run it again. A re-run checks the pull request’s current head commit, and re-running the check of an older commit does nothing. A re-run reads .a11ypulse.yml at the same base commit as the check it replaces, so to pick up config merged into the base branch since then, push a new commit to the pull request.

When you ignore an issue on a site, A11y Pulse re-runs the newest check of each open pull request for that site if it failed, so a pull request that failed only because of that issue can pass.

Limitations

  • Only pages A11y Pulse monitors for the site are checked. A page that exists only on the preview isn’t scanned.
  • Audits that capture screenshots as evidence are skipped, to keep checks fast. These include the Focus Appearance, Reflow, Text Spacing, and Filename Alt Text audits. Your scheduled scans still run them.
  • A check scans at most 25 pages.
  • Regression check scans don’t appear in your site’s scan history and don’t change its score.