Skip to main content
GetWCAG accessibility scanner logo
Beta

Configuration

Every input and output of the GetWCAG GitHub Action, with examples for the most common setups.

Choose which pages are checked#

Pages are found automatically. Pin the ones that matter most and leave out the ones that don't need checking:

Pinned and excluded pages
      - uses: GetWCAG-App/scan-action@v1
        with:
          api-key: ${{ secrets.GETWCAG_API_KEY }}
          start: npm start
          pages: /checkout, /signup
          exclude: /admin, /preview/*

Pinned pages count toward your plan's pages per run, so pin a few, not dozens. See How pages are chosen.

Set pages in GetWCAG instead

People who don't edit the repository, like QA or an accessibility lead, can set the same lists in the app. Open your project, go to CI checks, select Settings and fill in:

  • Always check: exact pages, one per line, like /checkout. They're checked first.
  • Never check: paths to leave out, like /admin, which also covers the pages under it. A * matches anything.

The lists apply from the next run, to every repository that uses the project. They're added to pages and exclude in the workflow, so both places count, and a page on either never list is never checked. The pull request comment says when lists from GetWCAG were used. Each list holds up to 50 paths. See Settings.

Ignore third-party elements#

A cookie banner, chat widget or embedded video from another company can change without anyone on your team touching it, and its issues would show up as new on your next pull request. Leave them out with ignore:

Ignored elements
      - uses: GetWCAG-App/scan-action@v1
        with:
          api-key: ${{ secrets.GETWCAG_API_KEY }}
          start: npm start
          ignore: "#cookie-banner, .chat-widget, iframe[src*='youtube']"

Use any CSS selector, separated by commas or one per line. Everything inside a matched element is skipped too. The pull request comment lists what was ignored, so it's never hidden.

Use it for code you can't change

Ignored elements aren't checked at all. For your own code, fix the issue, or dismiss it in GetWCAG with a reason. After you change ignore, issues in newly ignored elements show as fixed on the next run.

Check a staging or preview URL#

If your app is already deployed somewhere, skip start and pass the URL. The check runs against that URL from the CI machine.

Staging URL
      - uses: GetWCAG-App/scan-action@v1
        with:
          api-key: ${{ secrets.GETWCAG_API_KEY }}
          url: https://staging.example.com

Vercel preview deployments

Run on deployment_status and pass the preview URL. If your previews are protected, add the protection bypass secret as a header.

.github/workflows/accessibility.yml
on: deployment_status

jobs:
  getwcag:
    if: github.event.deployment_status.state == 'success'
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
    steps:
      - uses: GetWCAG-App/scan-action@v1
        with:
          api-key: ${{ secrets.GETWCAG_API_KEY }}
          url: ${{ github.event.deployment_status.environment_url }}
          headers: |
            x-vercel-protection-bypass: ${{ secrets.VERCEL_AUTOMATION_BYPASS_SECRET }}

Sites with a language prefix

If your home page redirects to /en or another language, wait for that page instead. Pages are still checked on the same origin.

Waiting for a language prefix
          start: npm start
          wait-for: http://localhost:3000/en

Inputs#

InputDefaultWhat it does
api-keyNoneYour project's CI key. Required. Store it as a secret.
pagesNonePages always checked first, one per line or comma separated, like /checkout, /signup.
discovertrueFind the other pages from your sitemap and links. false checks only pages (or / if empty).
excludeNonePaths never to check, like /admin, /preview/*. A * works as a wildcard.
per-template2How many pages of each kind to check, 1 to 10.
ignoreNoneElements never to check, as CSS selectors, like #cookie-banner, .chat-widget. Everything inside them is skipped too.
hide-textfalseLeave all page text and free-text attributes out of what's sent and shown. For pages with personal data.
urlNoneBase URL to check, like a staging or preview URL. Leave empty when you use start.
startNoneCommand that starts your app on the CI machine, like npm start. Runs in the background.
wait-forhttp://localhost:3000URL to wait for before checking. Can be a page, like http://localhost:3000/en. Pages are checked on its origin.
wait-timeout120Seconds to wait for your app to answer, 1 to 1800.
fail-onseriousFail on new issues at this level or worse: critical, serious, moderate, minor or none.
headersNoneExtra request headers, one Name: value per line. Sent only to your site, never to GetWCAG or anyone else.
commenttrueComment on the pull request. Needs the pull-requests: write permission.
fail-on-errorfalseFail when GetWCAG can't finish, for example when it can't be reached. By default it only warns.
github-tokengithub.tokenToken used for the pull request comment.

Turning hide-text on or off

hide-text changes what issues are matched on, so reset the baseline in the CI checks tab after you change it. Otherwise the next pull request shows every issue as new.

Outputs#

OutputValue
resultpassed, failed, skipped or error
run-idThe GetWCAG run ID
new-issuesNumber of new issues
fixed-issuesNumber of fixed issues

Use them in later steps, for example to post to Slack:

Using an output
      - uses: GetWCAG-App/scan-action@v1
        id: getwcag
        with:
          api-key: ${{ secrets.GETWCAG_API_KEY }}
          start: npm start
      - if: always()
        run: echo "New issues: ${{ steps.getwcag.outputs.new-issues }}"