Skip to content

Add some wrong things #9

Add some wrong things

Add some wrong things #9

Workflow file for this run

name: axe
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
axe:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x
- run: npm ci
- run: npm run dev & npx wait-on http://localhost:3000
- name: Install browser drivers
run: npx browser-driver-manager install chrome
- name: Get URLs to scan based on changed files
id: urls
env:
GITHUB_BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: |
# Fetch base branch to ensure valid git history
git fetch origin ${{ github.event.pull_request.base.ref }}
URLS=$(node scripts/get-changed-urls.js http://localhost:3000 --include-home)
echo "urls<<EOF" >> $GITHUB_OUTPUT
echo "$URLS" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Run axe on changed pages
run: |
npm install -g @axe-core/cli
# Scan each changed URL
echo "${{ steps.urls.outputs.urls }}" | while read url; do
[ -z "$url" ] && continue
echo "Scanning: $url"
axe "$url" --exit
done