Add some wrong things #9
This file contains hidden or 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
| 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 |