A GitHub Action to lint for any accessibility issues in your pull requests. This is a fork of the offical action from Deque.
- Dependencies are updated and will be maintained
- You can choose the supported file types to be linted by the action
- Linting is extended to the shell script as well
- A debug mode has been added to the shell script
- Semantic versioning will be used
Required Your GitHub token for authentication.
Required Your API key for axe-linter.
Optional The URL for the axe-linter API. Defaults to https://axe-linter.deque.com
.
Optional File patterns to check for changes. Defaults to '**/*.js,**/*.jsx,**/*.tsx,**/*.html,**/*.vue,**/*.md,**/*.markdown'
.
You may also use a multiline string to specify multiple patterns.
Optional File patterns to ignore. Example: **/test/*,**/docs/*
.
You may also use a multiline string to specify multiple patterns.
* To request an API key for axe-linter, please visit accessibility.deque.com/linter-contact-us. Once provisioned please visit https://docs.deque.com/linter/1.0.0/en/axe-linter-api-keyto get your API key.
Add the DEBUG_MODE
environment variable to run the shell script in debug output mode.
steps:
<your steps>
env:
DEBUG_MODE: 'true'
Create a file in your repository called .github/workflows/axe-linter.yml
with the following contents, or add the steps to an existing workflow:
name: Lint for accessibility issues
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: mattbangert/axe-linter-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
api_key: ${{ secrets.AXE_LINTER_API_KEY }}
axe_linter_url: https://axe-linter.deque.com
files_pattern: '**/*.js,**/*.jsx,**/*.tsx,**/*.html,**/*.vue,**/*.md,**/*.markdown'
If you need to better define your inclusions/exclusions, you may use a combination of files_pattern
and files_ignore_pattern
:
files_pattern: |
packages/client/**/*.{js,jsx,tsx,html,vue}
src/**/*.{js,jsx,tsx,html,vue}
files_ignore_pattern: |
src/**/*_test.{js,jsx,tsx,html,vue}
**/tests/**/*.{js,jsx,tsx,html,htm,vue}