Skip to content

A GitHub Action to lint for any accessibility issues in your pull requests.

License

Notifications You must be signed in to change notification settings

mattbangert/axe-linter-action

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

axe-linter-action

GitHub last commit GitHub Actions Workflow Status GitHub Downloads (all assets, all releases) GitHub Issues or Pull Requests GitHub Release

A GitHub Action to lint for any accessibility issues in your pull requests. This is a fork of the offical action from Deque.

Key Differences from the Offical Action

  • 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

Input

github_token

Required Your GitHub token for authentication.

api_key

Required Your API key for axe-linter.

axe_linter_url

Optional The URL for the axe-linter API. Defaults to https://axe-linter.deque.com.

files_pattern

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.

files_ignore_pattern

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.

Environment Variables

Add the DEBUG_MODE environment variable to run the shell script in debug output mode.

steps:
     <your steps>
        env:
          DEBUG_MODE: 'true'

Example Usage

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}

About

A GitHub Action to lint for any accessibility issues in your pull requests.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 85.6%
  • HTML 14.4%