CI Integration
GitHub Actions example
Section titled “GitHub Actions example”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.jsonUpdating the baseline
Section titled “Updating the baseline”When you intentionally change CLI output, update the baseline:
a11y-lint scan output.txt --json > baseline/a11y.scorecard.jsongit add baseline/a11y.scorecard.jsongit commit -m "Update a11y baseline"How it works
Section titled “How it works”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)Best practices
Section titled “Best practices”- Gate on errors, not grades — use exit codes
- Enable specific rules for WCAG compliance
- Track baselines to detect regressions
- Keep allowlist expiry dates short