Skip to content

Add exclude input to skip CSS selectors from Axe scan#213

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/add-exclude-selectors-feature
Closed

Add exclude input to skip CSS selectors from Axe scan#213
Copilot wants to merge 2 commits intomainfrom
copilot/add-exclude-selectors-feature

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 1, 2026

Embedded iframes, third-party widgets, and user-generated content often should not be scanned. This adds an exclude input (stringified JSON array of CSS selectors) that maps directly to AxeBuilder.exclude() before analyze() is called.

Changes

  • action.yml (root) — New exclude input; forwarded to the find step
  • .github/actions/find/action.yml — New exclude input declared
  • find/src/index.ts — Parses exclude JSON with a clear error on malformed input; passes parsed array to findForUrl
  • find/src/findForUrl.tsfindForUrl and runAxeScan accept exclude?: string[]; selectors applied via reduce over axeBuilder.exclude() before analyze()
  • README.md — Input documented in the inputs table and getting-started example

Usage

- uses: github/accessibility-scanner@v1
  with:
    urls: |
      https://example.com
    exclude: '["iframe", "#third-party-widget", ".user-generated-content"]'

Copilot AI linked an issue May 1, 2026 that may be closed by this pull request
4 tasks
Copilot AI changed the title [WIP] Add the ability to exclude selectors from scanner Add exclude input to skip CSS selectors from Axe scan May 1, 2026
Copilot AI requested a review from abdulahmad307 May 1, 2026 16:12
@abdulahmad307
Copy link
Copy Markdown
Contributor

abdulahmad307 commented May 4, 2026

Actually, I don't think this is the right approach. It would make more sense if each page/url had its own exclude list. We might want to introduce a new urlConfig input that takes a list of objects with the url as a field, and any other configuration options (as opposed to the current flat list of urls). We can keep the old flat url list as an input too for those who don't need the extra configurability

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the ability to exclude selectors from scanner

2 participants