|
| 1 | +# Orchestrating workflow: Scan all demo apps in parallel |
| 2 | +# Manually triggered - runs accessibility scans on all 5 demo apps simultaneously |
| 3 | + |
| 4 | +name: Scan All Demo Apps |
| 5 | + |
| 6 | +on: |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + security-events: write |
| 12 | + |
| 13 | +env: |
| 14 | + SCANNER_BASE_URL: https://a11y-scan-demo-app.azurewebsites.net |
| 15 | + |
| 16 | +jobs: |
| 17 | + scan: |
| 18 | + name: Scan ${{ matrix.siteName }} |
| 19 | + runs-on: ubuntu-latest |
| 20 | + timeout-minutes: 5 |
| 21 | + strategy: |
| 22 | + fail-fast: false |
| 23 | + max-parallel: 5 |
| 24 | + matrix: |
| 25 | + include: |
| 26 | + - siteName: a11y-demo-app-001 |
| 27 | + siteUrl: https://a11y-demo-app-001-app.azurewebsites.net/ |
| 28 | + - siteName: a11y-demo-app-002 |
| 29 | + siteUrl: https://a11y-demo-app-002-app.azurewebsites.net/ |
| 30 | + - siteName: a11y-demo-app-003 |
| 31 | + siteUrl: https://a11y-demo-app-003-app.azurewebsites.net/ |
| 32 | + - siteName: a11y-demo-app-004 |
| 33 | + siteUrl: https://a11y-demo-app-004-app.azurewebsites.net/ |
| 34 | + - siteName: a11y-demo-app-005 |
| 35 | + siteUrl: https://a11y-demo-app-005-app.azurewebsites.net/ |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v4 |
| 38 | + |
| 39 | + - name: Run accessibility scan - ${{ matrix.siteName }} |
| 40 | + run: | |
| 41 | + mkdir -p results |
| 42 | + HTTP_STATUS=$(curl -s -o results/${{ matrix.siteName }}.sarif -w "%{http_code}" \ |
| 43 | + -X POST "${{ env.SCANNER_BASE_URL }}/api/ci/scan" \ |
| 44 | + -H "Content-Type: application/json" \ |
| 45 | + -d '{"url": "${{ matrix.siteUrl }}", "format": "sarif"}' \ |
| 46 | + --max-time 120) |
| 47 | +
|
| 48 | + echo "HTTP status: $HTTP_STATUS" |
| 49 | +
|
| 50 | + if [ "$HTTP_STATUS" -ne 200 ]; then |
| 51 | + echo "::error::Scan failed for ${{ matrix.siteUrl }} (HTTP $HTTP_STATUS)" |
| 52 | + cat results/${{ matrix.siteName }}.sarif |
| 53 | + exit 1 |
| 54 | + fi |
| 55 | +
|
| 56 | + echo "SARIF file written: results/${{ matrix.siteName }}.sarif" |
| 57 | + echo "File size: $(wc -c < results/${{ matrix.siteName }}.sarif) bytes" |
| 58 | +
|
| 59 | + - name: Upload SARIF artifact - ${{ matrix.siteName }} |
| 60 | + uses: actions/upload-artifact@v4 |
| 61 | + if: always() |
| 62 | + with: |
| 63 | + name: a11y-sarif-${{ matrix.siteName }} |
| 64 | + path: results/ |
| 65 | + |
| 66 | + - name: Upload SARIF to GitHub Security - ${{ matrix.siteName }} |
| 67 | + uses: github/codeql-action/upload-sarif@v4 |
| 68 | + if: always() |
| 69 | + with: |
| 70 | + sarif_file: results/${{ matrix.siteName }}.sarif |
| 71 | + category: a11y-${{ matrix.siteName }} |
| 72 | + wait-for-processing: true |
0 commit comments