|
1 | | -# continuous-ai-for-accessibility-scanner |
| 1 | +# AI-powered Accessibility Scanner |
2 | 2 |
|
3 | | -Finds potential accessibility gaps, files GitHub issues to track them, and attempts to fix them with Copilot. |
| 3 | +The AI-powered Accessibility Scanner (a11y scanner) is a GitHub Action that detects accessibility barriers across your digital products, creates trackable issues, and leverages Copilot for AI-powered fixes. |
4 | 4 |
|
5 | | -## Usage |
| 5 | +The a11y scanner helps teams: |
6 | 6 |
|
7 | | -### Inputs |
| 7 | +- 🔍 Scan websites, files, repositories, and dynamic content for accessibility issues |
| 8 | +- 📝 Create actionable GitHub issues that can be assigned to Copilot |
| 9 | +- 🤖 Propose fixes with Copilot, with humans reviewing before merging |
8 | 10 |
|
9 | | -#### `urls` |
| 11 | +> ⚠️ **Note:** The a11y scanner is currently in beta. It can help identify accessibility gaps but cannot guarantee fully accessible code suggestions. Always review before merging! |
10 | 12 |
|
11 | | -**Required** Newline-delimited list of URLs to check for accessibility issues. For example: |
| 13 | +--- |
12 | 14 |
|
13 | | -```txt |
14 | | -https://primer.style |
15 | | -https://primer.style/octicons/ |
16 | | -``` |
17 | | - |
18 | | -#### `repository` |
19 | | - |
20 | | -**Required** Repository (with owner) to file issues in. For example: `primer/primer-docs`. |
21 | | - |
22 | | -#### `token` |
23 | | - |
24 | | -**Required** Personal access token (PAT) with fine-grained permissions 'contents: write', 'issues: write', and 'pull_requests: write'. |
| 15 | +## Getting Started |
25 | 16 |
|
26 | | -#### `cache_key` |
| 17 | +### 1. Add a Workflow File |
27 | 18 |
|
28 | | -**Optional** Custom key for caching findings across runs. Allowed characters are `A-Za-z0-9._/-`. For example: `cached_findings-main-primer.style.json`. |
29 | | - |
30 | | -### Example workflow |
| 19 | +Create a workflow file in `.github/workflows/` (e.g., `a11y-scan.yml`) in your repository: |
31 | 20 |
|
32 | 21 | ```YAML |
33 | | -name: Continuous Accessibility Scanner |
34 | | -on: workflow_dispatch |
| 22 | +name: Accessibility Scanner |
| 23 | +on: workflow_dispatch # This configures the workflow to run manually, instead of (e.g.) automatically in every PR. Check out https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#on for more options. |
35 | 24 |
|
36 | 25 | jobs: |
37 | | - continuous_accessibility_scanner: |
| 26 | + accessibility_scanner: |
38 | 27 | runs-on: ubuntu-latest |
39 | 28 | steps: |
| 29 | + # Retrieve the scanner code |
40 | 30 | - uses: actions/checkout@v5 |
41 | 31 | with: |
42 | 32 | repository: github-community-projects/continuous-ai-for-accessibility-scanner |
43 | | - token: ${{ secrets.GH_COMMUNITY_PROJECTS_TOKEN }} |
| 33 | + ref: v1 |
| 34 | + token: ${{ secrets.GH_COMMUNITY_PROJECTS_TOKEN }} # This token must have read access to github-community-projects/continuous-ai-for-accessibility-scanner; more information below. |
44 | 35 | path: ./.github/actions/continuous-ai-for-accessibility-scanner |
| 36 | + # Prepare the scanner to run |
45 | 37 | - shell: bash |
46 | 38 | run: cp -Rf ./.github/actions/continuous-ai-for-accessibility-scanner/.github/actions/* ./.github/actions |
| 39 | + # Run the scanner |
47 | 40 | - uses: ./.github/actions/continuous-ai-for-accessibility-scanner |
48 | 41 | with: |
49 | | - urls: | |
50 | | - https://primer.style/octicons/ |
51 | | - repository: github/accessibility-sandbox |
52 | | - token: ${{ secrets.GH_TOKEN }} |
| 42 | + urls: | # Provide a newline-delimited list of URLs to scan; more information below. |
| 43 | + REPLACE_THIS |
| 44 | + repository: REPLACE_THIS/REPLACE_THIS # Provide a repository name-with-owner (in the format "primer/primer-docs"). This is where issues will be filed and where Copilot will open PRs; more information below. |
| 45 | + token: ${{ secrets.GH_TOKEN }} # This token must have write access to the repo above (contents, issues, and PRs); more information below. Note: GitHub Actions’ `GITHUB_TOKEN` (https://docs.github.com/en/actions/tutorials/authenticate-with-github_token) cannot be used here. |
53 | 46 | ``` |
| 47 | +
|
| 48 | +> 👉 Update all `REPLACE_THIS` placeholders with your actual values. See [Action Inputs](#action-inputs) for details. |
| 49 | + |
| 50 | +Required Permissions: |
| 51 | + |
| 52 | +- Write access to add or update workflows |
| 53 | +- Admin access to add repository secrets |
| 54 | + |
| 55 | +📚 [Understanding GitHub Actions](https://docs.github.com/en/actions/get-started/understand-github-actions) | [Managing GitHub Actions settings](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository) | [Writing workflows](https://docs.github.com/en/actions/how-tos/write-workflows) |
| 56 | + |
| 57 | +--- |
| 58 | + |
| 59 | +### 2. Create Tokens and Add Secrets |
| 60 | + |
| 61 | +The a11y scanner requires two Personal Access Tokens (PATs) as repository secrets: |
| 62 | + |
| 63 | +#### The `GH_COMMUNITY_PROJECTS_TOKEN` is a fine-grained PAT with |
| 64 | + |
| 65 | +- `contents: read` |
| 66 | +- `metadata: read` |
| 67 | +- Scope: [`github-community-projects/continuous-ai-for-accessibility-scanner`](https://github.com/github-community-projects/continuous-ai-for-accessibility-scanner) |
| 68 | + |
| 69 | +#### The `GH_TOKEN` is a fine-grained PAT with |
| 70 | + |
| 71 | +- `contents: write` |
| 72 | +- `issues: write` |
| 73 | +- `pull-requests: write` |
| 74 | +- `metadata: read` |
| 75 | +- Scope: Your target repository (where issues and PRs will be created) |
| 76 | + |
| 77 | +> 👉 GitHub Actions' default `GITHUB_TOKEN` cannot be used here. |
| 78 | + |
| 79 | +📚 [Creating a fine-grained PAT](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) | [Creating repository secrets](https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-secrets#creating-secrets-for-a-repository) |
| 80 | + |
| 81 | +--- |
| 82 | + |
| 83 | +### 3. Run Your First Scan |
| 84 | + |
| 85 | +Trigger the workflow manually or automatically based on your configuration. The scanner will run and create issues for any accessibility findings. When issues are assigned to Copilot, always review proposed fixes before merging. |
| 86 | + |
| 87 | +📚 [Running a workflow manually](https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow#running-a-workflow) |
| 88 | + |
| 89 | +--- |
| 90 | + |
| 91 | +## Action Inputs |
| 92 | + |
| 93 | +| Input | Required | Description | Example | |
| 94 | +|-------|----------|-------------|---------| |
| 95 | +| `urls` | Yes | Newline-delimited list of URLs to scan | `https://primer.style`<br>`https://primer.style/octicons` | |
| 96 | +| `repository` | Yes | Repository (with owner) for issues and PRs | `primer/primer-docs` | |
| 97 | +| `token` | Yes | PAT with write permissions (see above) | `${{ secrets.GH_TOKEN }}` | |
| 98 | +| `cache_key` | No | Custom key for caching findings across runs<br>Allowed: `A-Za-z0-9._/-` | `cached_findings-main-primer.style.json` | |
| 99 | + |
| 100 | +--- |
| 101 | + |
| 102 | +## Configuring Copilot |
| 103 | + |
| 104 | +The a11y scanner leverages Copilot coding agent, which can be configured with custom instructions: |
| 105 | + |
| 106 | +- Repository-wide: `.github/copilot-instructions.md` |
| 107 | +- Directory/file-scoped: `.github/instructions/*.instructions.md` |
| 108 | + |
| 109 | +📚 [Adding repository custom instructions](https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions) | [Copilot .instructions.md support](https://github.blog/changelog/2025-07-23-github-copilot-coding-agent-now-supports-instructions-md-custom-instructions/) |
| 110 | + |
| 111 | +--- |
| 112 | + |
| 113 | +## Feedback |
| 114 | + |
| 115 | +Beta participants have direct contact for questions and suggestions. A public feedback form will be available once the project is open-sourced. |
| 116 | + |
| 117 | +--- |
| 118 | + |
| 119 | +*Last updated: 2025-08-28* |
0 commit comments