Multiple pages and sites
Scan several pages, several bundles, or several apps from one repository.
Each QualityGate run scans one URL with one bundle. To cover more, run the step more than once. Every run is authorized, counted, and recorded separately.
Several pages with a matrix
A GitHub Actions matrix runs one scan per page in parallel:
name: QualityGate
on:
pull_request:
permissions:
contents: read
id-token: write
jobs:
quality:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
page: ['/', '/pricing', '/checkout', '/blog/welcome']
name: quality ${{ matrix.page }}
steps:
- run: npx -y playwright@1.61.1 install --with-deps chromium
- uses: qualitygate/scan-action@v1
with:
url: https://pr-${{ github.event.pull_request.number }}.preview.example.com${{ matrix.page }}
# One pull request comment is shared by every run; let one page own it.
comment: ${{ matrix.page == '/' && 'true' || 'false' }}
Things to know:
fail-fast: falselets every page finish even when one fails, so you see all the results at once.- Each page is its own check in the pull request, named after the matrix entry. Require the ones that matter in branch protection.
- There is one QualityGate comment per pull request. Parallel runs would overwrite each other, so the example lets one page post it. Every page still writes its full report to its own job summary and to run history.
- Each page counts as one run against your monthly allowance.
Several bundles on the same page
Run the cheap checks together with full and keep the slower ones separate:
strategy:
fail-fast: false
matrix:
bundle: [full, perf]
steps:
- run: npx -y playwright@1.61.1 install --with-deps chromium
- uses: qualitygate/scan-action@v1
with:
url: ${{ vars.QUALITYGATE_PREVIEW_URL }}
bundle: ${{ matrix.bundle }}
comment: ${{ matrix.bundle == 'full' && 'true' || 'false' }}
full already runs accessibility, SEO, security headers, and links in a single
page load, which is cheaper than four separate runs.
Several apps in one repository
A QualityGate project maps to one repository, so a monorepo with several deployed apps is one project. Add every app’s preview host to the project’s allowed domains (up to 50 entries), then scan each app’s URL:
strategy:
fail-fast: false
matrix:
include:
- app: web
url: https://web-pr-${{ github.event.pull_request.number }}.preview.example.com/
- app: docs
url: https://docs-pr-${{ github.event.pull_request.number }}.preview.example.com/
name: quality ${{ matrix.app }}
steps:
- run: npx -y playwright@1.61.1 install --with-deps chromium
- uses: qualitygate/scan-action@v1
with:
url: ${{ matrix.url }}
comment: ${{ matrix.app == 'web' && 'true' || 'false' }}
To skip apps a pull request did not touch, combine this with a path filter such
as on.pull_request.paths in a separate workflow per app.
How this interacts with regression mode
Baselines are stored per page path and bundle, so /pricing on a preview is
compared with /pricing on your main branch, whatever the hostnames are. Give
your main-branch push workflow the same list of pages and bundles, or pages
without a baseline pass with a “no comparison yet” note. See
Gates and regression mode.