Run the official websecaudit/website-vulnerability-scanner@v0.2.1 composite Action against preview or staging URLs and surface findings directly under the repository Security tab.
name: Website Security Audit
on:
schedule:
- cron: "0 6 * * 1"
workflow_dispatch:
jobs:
web-audit:
runs-on: ubuntu-latest
permissions:
security-events: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Run website and API audit
uses: websecaudit/website-vulnerability-scanner@v0.2.1
with:
target: https://example.com
profile: web
openapi: ""
sarif: web-audit.sarif
fail-on: high
max-requests: "120"
- name: Upload SARIF to GitHub Code Scanning
if: always()
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: web-audit.sarif
Each exported SARIF result carries a deterministic partialFingerprints value computed by compute_fingerprint from rule ID, normalized path, and issue evidence. Re-running the workflow updates open alert states cleanly without creating duplicate alerts on every commit.
When --fail-on triggers exit code 2, subsequent steps normally stop. Adding if: always() ensures GitHub still receives the SARIF report so developers see the alert details inside the Security tab.
Yes, for public repos and GitHub Advanced Security repos. On private repos without Advanced Security, output HTML, Markdown, or JSON reports as workflow artifacts instead of calling upload-sarif.
Fail builds only on new or worsened findings with --baseline and --fail-on-regression.
Pass openapi and rules inputs directly to the GitHub Action.
See all exit codes and Docker headless invocation options.