Skip to content

Commit 9f9bb3d

Browse files
committed
update docs more
- add scans input to top level action.yml
1 parent d75e16e commit 9f9bb3d

3 files changed

Lines changed: 31 additions & 28 deletions

File tree

.github/actions/find/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ inputs:
1414
required: false
1515
default: 'false'
1616
scans:
17-
description: 'Stringified JSON array of scans to perform. If not provided, only axe will be performed'
17+
description: 'Stringified JSON array of scans to perform. If not provided, only Axe will be performed'
1818
required: false
1919
reduced_motion:
20-
description: "Playwright reducedMotion setting: https://playwright.dev/docs/api/class-browser#browser-new-page-option-reduced-motion"
20+
description: 'Playwright reducedMotion setting: https://playwright.dev/docs/api/class-browser#browser-new-page-option-reduced-motion'
2121
required: false
2222
color_scheme:
23-
description: "Playwright colorScheme setting: https://playwright.dev/docs/api/class-browser#browser-new-context-option-color-scheme"
23+
description: 'Playwright colorScheme setting: https://playwright.dev/docs/api/class-browser#browser-new-context-option-color-scheme'
2424
required: false
2525

2626
outputs:

PLUGINS.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22

33
The plugin system allows teams to create custom scans/tests to run on their pages. An example of this is Axe interaction tests. In some cases, it might be desirable to perform specific interactions on elements of a given page before doing an Axe scan. These interactions are usually unique to each page that is scanned, so it would require the owning team to write a custom plugin that can interact with the page and run the Axe scan when ready. See the example under [.github/scanner-plugins/test-plugin](https://github.com/github/accessibility-scanner/tree/main/.github/scanner-plugins/test-plugin) (this is not an Axe interaction test, but should give a general understanding of plugin structure).
44

5-
Some plugins come built-in with the scanner and can be enabled via actions inputs.
5+
Some plugins come built-in with the scanner and can be enabled via [actions inputs](https://github.com/github/accessibility-scanner/tree/main/action.yml#L48-L50).
66

7-
## How Plugins Work
7+
## How plugins work
88

99
Plugins are dynamically loaded by the scanner when it runs. The scanner will look into the `./.github` folder in your repo (where you run the workflow from) and search for a `scanner-plugins` folder. If it finds it, it will assume each folder under that is a plugin, and attempt to load the `index.js` file inside it. Once loaded, the scanner will invoke the exported default function from the `index.js` file.
1010

1111
### Default function API
1212

1313
When the default function is invoked, the following arguments are passed to the function:
1414

15-
- page: this is the [playwright page](https://playwright.dev/docs/api/class-page) instance. See the linked docs for information on how to interact with the page.
16-
- addFinding: this is a function that will add a finding to the list. Findings are used to generate issues and 'filings'. See here for the [types](https://github.com/github/accessibility-scanner/blob/main/tests/types.d.ts). This function expects a single object as an argument, and it should match the `Finding` type defined in the types linked above.
15+
- `page`: this is the [playwright page](https://playwright.dev/docs/api/class-page) instance.
16+
- `addFinding`: this is a function that will add a finding to the list. Findings are used to generate and file issues. This function expects a single object as an argument, and it should match the [`Finding` type](https://github.com/github/accessibility-scanner/blob/main/.github/actions/find/src/types.d.ts#L1-L9).
1717

18-
## How To Create Plugins
18+
## How to create plugins
1919

2020
As mentioned above, plugins need to exist under `./.github/scanner-plugins`. For a plugin to work, it needs to meet the following criteria:
2121

22-
- Each seperate plugin should exist in a separate folder under `./.github/scanner-plugins`. So `./.github/scanner-plugins/plugin-1` would be 1 plugin loaded by the scanner.
22+
- Each separate plugin should be contained in it's own directory in `./.github/scanner-plugins`. For example, `./.github/scanner-plugins/plugin-1` would be 1 plugin loaded by the scanner.
2323
- Each plugin should have one `index.js` file inside its folder.
2424
- The `index.js` file must export a `name` field. This is the name used to pass to the `scans` input. So the following: `scans: ['my-custom-plugin']` would cause the scanner to only run that plugin.
2525
- The `index.js` file must export a default function. This is the function that the scanner uses to run the plugin. This can be an async function.

action.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,61 @@
1-
name: "accessibility-scanner"
2-
description: "Finds potential accessibility gaps, files GitHub issues to track them, and attempts to fix them with Copilot."
1+
name: 'accessibility-scanner'
2+
description: 'Finds potential accessibility gaps, files GitHub issues to track them, and attempts to fix them with Copilot.'
33

44
inputs:
55
urls:
6-
description: "Newline-delimited list of URLs to check for accessibility issues"
6+
description: 'Newline-delimited list of URLs to check for accessibility issues'
77
required: true
88
multiline: true
99
repository:
10-
description: "Repository (with owner) to file issues in"
10+
description: 'Repository (with owner) to file issues in'
1111
required: true
1212
token:
1313
description: "Personal access token (PAT) with fine-grained permissions 'contents: write', 'issues: write', and 'pull_requests: write'"
1414
required: true
1515
cache_key:
16-
description: "Key for caching results across runs"
16+
description: 'Key for caching results across runs'
1717
required: true
1818
login_url:
19-
description: "If scanned pages require authentication, the URL of the login page"
19+
description: 'If scanned pages require authentication, the URL of the login page'
2020
required: false
2121
username:
22-
description: "If scanned pages require authentication, the username to use for login"
22+
description: 'If scanned pages require authentication, the username to use for login'
2323
required: false
2424
password:
25-
description: "If scanned pages require authentication, the password to use for login"
25+
description: 'If scanned pages require authentication, the password to use for login'
2626
required: false
2727
auth_context:
2828
description: "If scanned pages require authentication, a stringified JSON object containing 'username', 'password', 'cookies', and/or 'localStorage' from an authenticated session"
2929
required: false
3030
skip_copilot_assignment:
31-
description: "Whether to skip assigning filed issues to Copilot"
31+
description: 'Whether to skip assigning filed issues to Copilot'
3232
required: false
33-
default: "false"
33+
default: 'false'
3434
include_screenshots:
35-
description: "Whether to capture screenshots and include links to them in the issue"
35+
description: 'Whether to capture screenshots and include links to them in the issue'
3636
required: false
37-
default: "false"
37+
default: 'false'
3838
open_grouped_issues:
3939
description: "In the 'file' step, also open grouped issues which link to all issues with the same problem"
4040
required: false
41-
default: "false"
41+
default: 'false'
4242
reduced_motion:
43-
description: "Playwright reducedMotion setting: https://playwright.dev/docs/api/class-browser#browser-new-page-option-reduced-motion"
43+
description: 'Playwright reducedMotion setting: https://playwright.dev/docs/api/class-browser#browser-new-page-option-reduced-motion'
4444
required: false
4545
color_scheme:
46-
description: "Playwright colorScheme setting: https://playwright.dev/docs/api/class-browser#browser-new-context-option-color-scheme"
46+
description: 'Playwright colorScheme setting: https://playwright.dev/docs/api/class-browser#browser-new-context-option-color-scheme'
47+
required: false
48+
scans:
49+
description: 'Stringified JSON array of scans to perform. If not provided, only Axe will be performed'
4750
required: false
4851

4952
outputs:
5053
results:
51-
description: "List of issues and pull requests filed (and their associated finding(s)), as stringified JSON"
54+
description: 'List of issues and pull requests filed (and their associated finding(s)), as stringified JSON'
5255
value: ${{ steps.results.outputs.results }}
5356

5457
runs:
55-
using: "composite"
58+
using: 'composite'
5659
steps:
5760
- name: Make sub-actions referenceable
5861
working-directory: ${{ github.action_path }}
@@ -163,5 +166,5 @@ runs:
163166
token: ${{ inputs.token }}
164167

165168
branding:
166-
icon: "compass"
167-
color: "blue"
169+
icon: 'compass'
170+
color: 'blue'

0 commit comments

Comments
 (0)