Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
try post results as PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
rylew1 committed Jun 6, 2024
1 parent a08ba7b commit 58560fc
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/ci-frontend-a11y.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,30 @@ jobs:
./bin/wait-for-frontend.sh
- name: Run pa11y-ci
id: run-pa11y
run: |
set -e # Ensure the script fails if any command fails
npm run test:pa11y
npm run test:pa11y > pa11y-results.txt
echo "pa11y-ci tests finished."
- name: Upload screenshots to artifacts
- name: Parse and format Pa11y results
id: parse-pa11y
run: |
# Extract and format the results
grep -oP 'Errors in .+?:\n(?:\s+• .+?\n)+' pa11y-results.txt | sed 's/^/| /; s/$/ |/; 1i | URL | Errors |' > pa11y-report.md
- name: Upload screenshots
if: always()
uses: actions/upload-artifact@v3
with:
name: screenshots
path: ./frontend/screenshots-output

- name: Post Pa11y results as a PR comment
uses: marocchino/sticky-pull-request-comment@v2
with:
message: |
## Pa11y Accessibility Test Results
$(cat pa11y-report.md)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 58560fc

Please sign in to comment.