GitHub Action
The A11YSmith GitHub Action runs accessibility audits as part of your CI pipeline and posts results as pull request comments.
Basic Usage
- uses: HNguyenLy/a11ysmith-action@v1
with:
command: audit-web
url: https://example.com
format: json Inputs
| Input | Description | Required | Default |
|---|---|---|---|
command | The audit command to run | Yes | -- |
url | URL for web audits | No | -- |
dir | Directory for source audits | No | . |
file | File path(s) for document audits | No | -- |
format | Output format (json, markdown, html, all) | No | json |
output | Report output directory | No | a11ysmith-output |
fail-on-highest | Fail the workflow if highest-severity issues are found | No | true |
comment | Post results as a PR comment | No | true |
Outputs
| Output | Description |
|---|---|
report-path | Path to the generated report file |
total-findings | Total number of findings |
highest-count | Number of highest-severity findings |
high-count | Number of high-severity findings |
Platform-Specific Examples
Web Audit
- uses: HNguyenLy/a11ysmith-action@v1
with:
command: audit-web
url: ${{ env.DEPLOY_URL }}
format: html
fail-on-highest: true Document Audit
- uses: HNguyenLy/a11ysmith-action@v1
with:
command: audit-document
file: ./docs/report.docx
format: json Android Source Audit
- uses: HNguyenLy/a11ysmith-action@v1
with:
command: audit-android-source
dir: ./android-app
format: json iOS Source Audit
- uses: HNguyenLy/a11ysmith-action@v1
with:
command: audit-ios-source
dir: ./ios-app
format: markdown CI Workflow Example
A complete workflow that audits a staging deployment on every pull request:
name: Accessibility Audit
on:
pull_request:
branches: [main]
jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy to staging
id: deploy
run: echo "url=https://staging.example.com" >> "$GITHUB_OUTPUT"
- name: Run accessibility audit
uses: HNguyenLy/a11ysmith-action@v1
with:
command: audit-web
url: ${{ steps.deploy.outputs.url }}
format: markdown
comment: true
fail-on-highest: true