Skip to content

Commit 35e0a6b

Browse files
committed
docs: Add a 'Getting started' section to the README
1 parent c505dfd commit 35e0a6b

File tree

1 file changed

+55
-28
lines changed

1 file changed

+55
-28
lines changed

README.md

Lines changed: 55 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,60 @@
11
# continuous-ai-for-accessibility-scanner
22

3-
Finds potential accessibility gaps, files GitHub issues to track them, and attempts to fix them with Copilot.
3+
This repo contains code for a GitHub Actions action named `github-community-projects/continuous-ai-for-accessibility-scanner` (“scanner”, for short). The scanner finds potential accessibility gaps on a provided list of URLs, files GitHub issues to track them, and attempts to fix them with Copilot. For more information about GitHub Actions, check out [“Understanding GitHub Actions” (GitHub Docs)](https://docs.github.com/en/actions/get-started/understand-github-actions).
44

5-
## Usage
5+
## Getting started
6+
7+
### Adding a workflow file
8+
9+
To use the scanner, create a GitHub Actions workflow in the `.github/workflows` directory of one of your repositories (for example, a file named `scan.yml`), commit it, and push the commit.
10+
11+
For general workflow authoring tips, check out [“Writing workflows” (GitHub Docs)](https://docs.github.com/en/actions/how-tos/write-workflows); specifics are below.
12+
13+
The contents of the workflow file should look similar to the example below:
14+
15+
```YAML
16+
name: Continuous Accessibility Scanner
17+
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.
18+
19+
jobs:
20+
continuous_accessibility_scanner:
21+
runs-on: ubuntu-latest
22+
steps:
23+
# Retrieve the scanner code
24+
- uses: actions/checkout@v5
25+
with:
26+
repository: github-community-projects/continuous-ai-for-accessibility-scanner
27+
token: ${{ secrets.GH_COMMUNITY_PROJECTS_TOKEN }} # This token must have read access to github-community-projects/continuous-ai-for-accessibility-scanner; more information below.
28+
path: ./.github/actions/continuous-ai-for-accessibility-scanner
29+
# Prepare the scanner to run
30+
- shell: bash
31+
run: cp -Rf ./.github/actions/continuous-ai-for-accessibility-scanner/.github/actions/* ./.github/actions
32+
# Run the scannner
33+
- uses: ./.github/actions/continuous-ai-for-accessibility-scanner
34+
with:
35+
urls: | # Provide a newline-delimited list of URLs to scan; more information below.
36+
REPLACE_THIS
37+
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.
38+
token: ${{ secrets.GH_TOKEN }} # This token must have write access to the repo above (contents, issues, and PRs); more information below.
39+
```
40+
41+
All instances of `REPLACE_THIS` must be replaced before the workflow will run. For more information, check out the [`urls` input’s documentation](#urls) and the [`repository` input’s documentation](#repository).
42+
43+
### Creating tokens and adding secrets
44+
45+
After you’ve committed the workflow file to your repository, create two tokens, then add them as repository secrets named `GH_COMMUNITY_PROJECTS_TOKEN` and `GH_TOKEN`, respectively.
46+
47+
- `GH_COMMUNITY_PROJECTS_TOKEN` should be a fine-grained personal access token (PAT) with the `contents: read` and `metadata: read` permission for the `github-community-projects/continuous-ai-for-accessibility-scanner` repository.
48+
49+
- `GH_TOKEN` should be a fine-grained PAT with `contents: write`, `issues: write`, `pull-requests: write`, and `metadata: read` for the repository referenced in your workflow (the `repository` input).
50+
51+
Check out [“Creating a fine-grained personal access token” (GitHub Docs)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) and [“Creating secrets for a repository” (GitHub Docs)](https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-secrets#creating-secrets-for-a-repository) for step-by-step guidance.
52+
53+
### Scanning your website
54+
55+
Run your newly-added workflow, by following the instructions in [“Running a workflow” (GitHub Docs)](https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow#running-a-workflow).
56+
57+
## Configuring the action
658

759
### Inputs
860

@@ -21,33 +73,8 @@ https://primer.style/octicons/
2173

2274
#### `token`
2375

24-
**Required** Personal access token (PAT) with fine-grained permissions 'contents: write', 'issues: write', and 'pull_requests: write'.
76+
**Required** Personal access token (PAT) with fine-grained permissions 'contents: write', 'issues: write', 'pull_requests: write', and 'metadata: read'.
2577

2678
#### `cache_key`
2779

2880
**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
31-
32-
```YAML
33-
name: Continuous Accessibility Scanner
34-
on: workflow_dispatch
35-
36-
jobs:
37-
continuous_accessibility_scanner:
38-
runs-on: ubuntu-latest
39-
steps:
40-
- uses: actions/checkout@v5
41-
with:
42-
repository: github-community-projects/continuous-ai-for-accessibility-scanner
43-
token: ${{ secrets.GH_COMMUNITY_PROJECTS_TOKEN }}
44-
path: ./.github/actions/continuous-ai-for-accessibility-scanner
45-
- shell: bash
46-
run: cp -Rf ./.github/actions/continuous-ai-for-accessibility-scanner/.github/actions/* ./.github/actions
47-
- uses: ./.github/actions/continuous-ai-for-accessibility-scanner
48-
with:
49-
urls: |
50-
https://primer.style/octicons/
51-
repository: github/accessibility-sandbox
52-
token: ${{ secrets.GH_TOKEN }}
53-
```

0 commit comments

Comments
 (0)