generated from distantcam/windty
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: '♿ Pa11y' | ||
on: pull_request | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
- name: npm install, build | ||
run: | | ||
npm install | ||
npm run build | ||
- name: Run pa11y-ci. | ||
run: npm run pa11y-ci:sitemap 2>&1 | tee pa11y_output.txt | ||
|
||
- name: Read pa11y_output file. | ||
id: pa11y_output | ||
uses: juliangruber/read-file-action@v1 | ||
with: | ||
path: ./pa11y_output.txt | ||
|
||
- name: Comment on pull request. | ||
uses: thollander/actions-comment-pull-request@master | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
message: '<details><summary>Pa11y testing results</summary>```${{ steps.pa11y_output.outputs.content }}```</details>' | ||
|
||
- name: Check for pa11y failures. | ||
if: contains(steps.pa11y_output.outputs.content, 'errno 2') | ||
run: | | ||
echo "::error::The site is failing accessibility tests. Please review the comment in the pull request or the pa11y-ci step in the workflow for details." | ||
exit 1 |