Parse OWASP ZAP XML reports, publish a pull request summary comment, and fail the job when configured severities are found.
- Reads
zapreport-*.xmlfiles from a configurable directory. - Filters by severity threshold list.
- Sorts summary rows by severity (
Critical,High,Medium,Low,Informational). - Publishes a PR summary table with severity labels and occurrence counts.
- Fails workflow when matching alerts are present.
severities(optional): comma-separated severities that should fail the job. Default:Critical,High,Mediumreport-dir(optional): directory containingzapreport-*.xml. Default:test/output
permissions:
contents: read
pull-requests: write
issues: writeUse this action in pull request workflows after your ZAP scan step has generated XML reports.
name: DAST
on:
pull_request:
permissions:
contents: read
pull-requests: write
issues: write
jobs:
zap-annotate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Your ZAP scan step should produce test/output/zapreport-*.xml
- name: Run ZAP Annotation
uses: testingsoul/zap-annotations@v1
with:
severities: "Critical,High,Medium"
report-dir: "test/output"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}report-dirmust contain files named likezapreport-*.xml.- If any alert matches
severities, the step exits with code1to fail the job. - On
pull_requestevents, the action posts a comment to the PR with a summary table.
MIT