Overview and Pre-requisites
A11yInspect can be integrated with GitHub Actions to perform automated accessibility testing as part of your development workflow. Once configured, accessibility checks can run automatically when code is pushed to a repository, when a pull request is created or updated, or whenever a workflow is manually triggered.
The GitHub integration helps teams:
- Detect accessibility issues before deployment
- Review findings directly within GitHub
- Generate accessibility reports as part of CI/CD
- Enforce accessibility quality gates for pull requests
- Maintain compliance with WCAG requirements throughout development
Accessibility Check lifecycle
There is multiple stages of accessibility check lifecycle as:
Stage 1: Trigger
Workflow starts on push, PR, manual run, or scheduled execution.
| Event | When | Why it’s useful |
|---|---|---|
push to main | Someone pushes or merges into main | Keeps the main branch’s results and GitHub Issues current |
pull_request to main | A PR is opened, or new commits are pushed to it | Catches problems before they are merged. This is the most important trigger |
workflow_dispatch | Someone clicks Run workflow in the Actions tab | Let's you run a check on demand, which is useful for testing the setup |
schedule (optional) | At a fixed time, such as every Monday | Full audits and trend tracking (see Optional extras) |
Stage 2: Setup
GitHub runner installs Node.js, dependencies, and the A11yInspect CLI. GitHub starts a fresh Linux runner and prepares it:
- Checkout: downloads your repository’s code onto the runner.
- Install Node.js: A11yInspect is a
Node.jsprogram. The workflow also tells npm that packages named @barrierbreak/... come from GitHub Packages. - Install A11yInspect: downloads the @barrierbreak/a11yinspect package. This is where BB_NPM_TOKEN is used. It is a read-only download token. It can install this one package and nothing else.
- Install your project’s dependencies (React/JSX/TSX projects only): runs npm ci so React components can be checked accurately. It is skipped automatically if your repo has no package-lock.json.
Stage 3: Check
Source files are scanned against BarrierBreak accessibility rules. The A11yInspect CLI now does the actual work:
- License validation: the CLI sends
A11YINSPECT_LICENSE_KEYto the BarrierBreak API and confirms it is a valid Enterprise license. If not, it stops with a clear error message. - File discovery: it finds every file that matches the patterns you set (for example
src/**/*.{html,jsx,tsx}) and skips the excluded folders (node_modules , dist , build ). - Accessibility checks: each file is checked against BarrierBreak’s WCAG ruleset.
- Results: every issue comes with its WCAG success criterion, conformance level (A / AA / AAA), a plain-language explanation, and the exact file, line and column.
Stage 4: Report
Findings are published to PRs, Issues, Security Scanning, and artifacts. The results are delivered in several places at once, so each user can use the one that suits them:
| Where | What you see | Who it’s for |
|---|---|---|
Pull request to Files changed | Red inline notes on the exact lines with Fails | The developer who made the change |
Issues tab | GitHub Issues listing each Fail, labelled accessibility and a11yInspect. They are updated on each run, not duplicated. | Team leads, sprint planning |
Security to code scanning | Every finding, filterable and trackable over time | Security / quality owners |
Run Summary to Artifacts | fixa11y-reports.zip containing the HTML report and the SARIF file | Anyone, including people outside engineering |
Stage 5: Decide
Workflow passes or fails based on detected accessibility violations. The CLI finishes with an exit code, and GitHub uses that to mark the run:
| Result | Exit Code | What GitHub Shows | Effect on PR |
|---|---|---|---|
| No Fail-level Issues | 0 | Green tick | Can be merged |
| One or more fails found | 1 | Red Cross | Blocked from merging |
| Setup problem (bad key, install failure) | 1 | Red Cross | Blocked. Read the log (see Troubleshooting). |
The developer can read the annotations or report, fixes the code, and pushes again. That push triggers the cycle again until the check is green.
Pre-requisites
Before configuring A11yInspect for GitHub Actions, ensure you have the following:
- Administrator access to the target GitHub repository
- Permission to manage GitHub Actions workflows
- Access to repository secrets and settings
Required Credentials
Obtain the following credentials from BarrierBreak Team:
| Credentials | Purpose |
|---|---|
| A11YINSPECT_LICENSE_KEY | Authenticates your A11yInspect enterprise subscription |
| BB_NPM_TOKEN | Allows installation of A11yInspect packages |