Skip to content

Commit 1b95023

Browse files
new release (v3.2.0) (#217)
after merging this PR: #213 workflows are passing with main branch: https://github.com/github/accessibility-scorecard/actions/runs/25873353511
2 parents c8d6e40 + f9f4010 commit 1b95023

19 files changed

Lines changed: 445 additions & 366 deletions

.github/actions/auth/package-lock.json

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/auth/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
"license": "MIT",
1414
"type": "module",
1515
"dependencies": {
16-
"@actions/core": "^3.0.0",
17-
"playwright": "^1.59.1"
16+
"@actions/core": "^3.0.1",
17+
"playwright": "^1.60.0"
1818
},
1919
"devDependencies": {
20-
"@types/node": "^25.6.0",
20+
"@types/node": "^25.7.0",
2121
"typescript": "^6.0.3"
2222
}
2323
}

.github/actions/file/package-lock.json

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/file/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
"license": "MIT",
1414
"type": "module",
1515
"dependencies": {
16-
"@actions/core": "^3.0.0",
16+
"@actions/core": "^3.0.1",
1717
"@octokit/core": "^7.0.6",
1818
"@octokit/plugin-throttling": "^11.0.3"
1919
},
2020
"devDependencies": {
21-
"@types/node": "^25.6.0",
21+
"@types/node": "^25.7.0",
2222
"typescript": "^6.0.3"
2323
}
2424
}

.github/actions/find/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ description: 'Finds potential accessibility gaps.'
44
inputs:
55
urls:
66
description: 'Newline-delimited list of URLs to check for accessibility issues'
7-
required: true
7+
required: false
88
multiline: true
9+
url_configs:
10+
description: "Stringified JSON array of URL config objects, each with a 'url' field and an optional 'excludeSelectors' field (array of CSS selectors to exclude from the Axe scan for that URL). When provided, takes precedence over the 'urls' input."
11+
required: false
912
auth_context:
1013
description: "Stringified JSON object containing 'username', 'password', 'cookies', and/or 'localStorage' from an authenticated session"
1114
required: false

.github/actions/find/package-lock.json

Lines changed: 28 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/find/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
"license": "MIT",
1414
"type": "module",
1515
"dependencies": {
16-
"@actions/core": "^3.0.0",
17-
"@axe-core/playwright": "^4.11.2",
16+
"@actions/core": "^3.0.1",
17+
"@axe-core/playwright": "^4.11.3",
1818
"esbuild": "^0.28.0",
19-
"playwright": "^1.59.1"
19+
"playwright": "^1.60.0"
2020
},
2121
"devDependencies": {
22-
"@types/node": "^25.6.0",
22+
"@types/node": "^25.7.0",
2323
"typescript": "^6.0.3"
2424
}
2525
}

.github/actions/find/src/findForUrl.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {ColorSchemePreference, Finding, ReducedMotionPreference} from './types.d.js'
1+
import type {ColorSchemePreference, Finding, ReducedMotionPreference, UrlConfig} from './types.d.js'
22
import {AxeBuilder} from '@axe-core/playwright'
33
import playwright from 'playwright'
44
import {AuthContext} from './AuthContext.js'
@@ -8,12 +8,13 @@ import {getScansContext} from './scansContextProvider.js'
88
import * as core from '@actions/core'
99

1010
export async function findForUrl(
11-
url: string,
11+
urlConfig: UrlConfig,
1212
authContext?: AuthContext,
1313
includeScreenshots: boolean = false,
1414
reducedMotion?: ReducedMotionPreference,
1515
colorScheme?: ColorSchemePreference,
1616
): Promise<Finding[]> {
17+
const {url, excludeSelectors} = urlConfig
1718
const browser = await playwright.chromium.launch({
1819
headless: true,
1920
executablePath: process.env.CI ? '/usr/bin/google-chrome' : undefined,
@@ -56,7 +57,7 @@ export async function findForUrl(
5657
}
5758

5859
if (scansContext.shouldPerformAxeScan) {
59-
await runAxeScan({page, addFinding})
60+
await runAxeScan({page, addFinding, excludeSelectors})
6061
}
6162
} catch (e) {
6263
core.error(`Error during accessibility scan: ${e}`)
@@ -69,13 +70,18 @@ export async function findForUrl(
6970
async function runAxeScan({
7071
page,
7172
addFinding,
73+
excludeSelectors,
7274
}: {
7375
page: playwright.Page
7476
addFinding: (findingData: Finding, options?: {includeScreenshots?: boolean}) => Promise<void>
77+
excludeSelectors?: string[]
7578
}) {
7679
const url = page.url()
7780
core.info(`Scanning ${url}`)
78-
const rawFindings = await new AxeBuilder({page}).analyze()
81+
const axeBuilder = new AxeBuilder({page})
82+
excludeSelectors?.forEach(selector => axeBuilder.exclude(selector))
83+
84+
const rawFindings = await axeBuilder.analyze()
7985

8086
if (rawFindings) {
8187
for (const violation of rawFindings.violations) {

0 commit comments

Comments
 (0)