Skip to content

CI Integration

name: Accessibility Gate
on:
pull_request:
paths: ["src/**", "cli/**"]
jobs:
a11y:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install tools
run: pip install a11y-lint a11y-ci
- name: Capture CLI output
run: ./your-cli --help > cli_output.txt 2>&1 || true
- name: Lint and gate
run: |
a11y-lint scan cli_output.txt --json > a11y.scorecard.json
a11y-ci gate --current a11y.scorecard.json --baseline baseline/a11y.scorecard.json

When you intentionally change CLI output, update the baseline:

Terminal window
a11y-lint scan output.txt --json > baseline/a11y.scorecard.json
git add baseline/a11y.scorecard.json
git commit -m "Update a11y baseline"
Scorecard JSON ──► Parse findings + normalize severities
Allowlist JSON ──► Suppress matching IDs, flag expired entries
Baseline JSON ──► Compare counts + detect new IDs
┌───┴───┐
│ Gate │ severity + regression + expiry
└───┬───┘
PASS (exit 0) or FAIL (exit 3)
  1. Gate on errors, not grades — use exit codes
  2. Enable specific rules for WCAG compliance
  3. Track baselines to detect regressions
  4. Keep allowlist expiry dates short