CI recipes
Gate builds and post findings as a PR comment, with or without Cloud sync.
Gate builds and post triage results as a PR comment, with or without Cloud sync.
GitHub Actions
No Cloud needed: the job fails on the severities you choose and the Markdown summary goes into a PR comment. The comment step needs pull-requests: write permission.
steps:
- uses: actions/checkout@v7
- uses: capyshield-hq/capyshield/[email protected]
- run: capyshield guard --config capyshield.yaml -- npm ci
- run: capyshield actions --fail-on high
- uses: aquasecurity/[email protected]
with:
scan-type: fs
format: json
output: trivy.json
- run: capyshield vex --input trivy.json --summary vex.md --output openvex.json --fail-on high,critical
- if: always() && github.event_name == 'pull_request'
run: gh pr comment "${{ github.event.pull_request.number }}" --body-file vex.md
env:
GH_TOKEN: ${{ github.token }}With Cloud sync
Add --sync and a token to send results to your dashboard. vex --sync exits 1 when the upload is refused or the Cloud is unreachable, so keep the sync in its own step with continue-on-error if that shouldn't fail the build, and gate in a separate step:
- run: capyshield guard --config capyshield.yaml --sync -- npm ci
env:
CAPYSHIELD_TOKEN: ${{ secrets.CAPYSHIELD_TOKEN }}
- run: capyshield vex --input trivy.json --output openvex.json --sync
continue-on-error: true
env:
CAPYSHIELD_TOKEN: ${{ secrets.CAPYSHIELD_TOKEN }}
- run: capyshield vex --input trivy.json --summary vex.md --fail-on high,criticalGitLab
Post triage results as a merge request (MR) comment via GitLab CLI (glab).
capyshield vex --input trivy.json --summary vex.md --output openvex.json
glab mr note "$CI_MERGE_REQUEST_IID" -m "$(cat vex.md)" 2>/dev/null || trueBitbucket & Azure
Post the summary using the host's PR-comment API. Gate with --fail-on so the job fails on the severities you choose.