Skip to content

Commit 3905859

Browse files
snapsynapseclaude
andcommitted
ci(a11y): use skill-a11y-audit composite action instead of hand-rolling
Drops .pa11yci.json and replaces the pa11y-ci step with a single call to the new snapsynapse/skill-a11y-audit/.github/actions/scan@main composite action, which wraps the same axe-based scanner the skill already ships for non-CI use. The local-server setup and sandbox flag are now the skill's responsibility, not this repo's. The "Discover sitemap base URL" step keeps the template flexible so forks with a different config.url still scan against localhost. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5b8c4d8 commit 3905859

2 files changed

Lines changed: 12 additions & 25 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -69,28 +69,23 @@ jobs:
6969
- name: Build site
7070
run: node scripts/build.js
7171

72-
- name: Start local server
73-
run: |
74-
npx --yes http-server ./docs -p 8088 -c-1 > /tmp/http.log 2>&1 &
75-
for i in $(seq 1 30); do
76-
curl -fs http://localhost:8088/ > /dev/null && break || sleep 0.5
77-
done
78-
curl -fs http://localhost:8088/ > /dev/null || (cat /tmp/http.log; exit 1)
79-
80-
- name: Run pa11y-ci (WCAG 2.1 AA)
72+
- name: Discover sitemap base URL
73+
id: site
8174
run: |
8275
if [ -f docs/sitemap.xml ]; then
8376
SITE_BASE=$(grep -oE '<loc>[^<]+</loc>' docs/sitemap.xml | head -1 | sed -E 's|<loc>(.+)/?</loc>|\1|' | sed -E 's|/$||')
84-
npx --yes pa11y-ci \
85-
--config .pa11yci.json \
86-
--sitemap http://localhost:8088/sitemap.xml \
87-
--sitemap-find "$SITE_BASE" \
88-
--sitemap-replace 'http://localhost:8088' \
89-
--threshold 0
90-
else
91-
npx --yes pa11y-ci --config .pa11yci.json http://localhost:8088/ --threshold 0
77+
echo "base=$SITE_BASE" >> "$GITHUB_OUTPUT"
9278
fi
9379
80+
- name: Run skill-a11y-audit (WCAG 2.1 AA)
81+
uses: snapsynapse/skill-a11y-audit/.github/actions/scan@main
82+
with:
83+
serve-path: ./docs
84+
sitemap: http://localhost:8088/sitemap.xml
85+
sitemap-find: ${{ steps.site.outputs.base }}
86+
sitemap-replace: http://localhost:8088
87+
fail-on: errors
88+
9489
# GitHub Pages serves directly from `main` branch root on this repo.
9590
# Template forks that want automated deploy-to-gh-pages can add back the
9691
# peaceiris/actions-gh-pages step here and set permissions.contents to write.

‎.pa11yci.json‎

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)