Loading...
Loading...
Add a squirrelscan CI check using the squirrel CLI in Claude Code, Codex, Cursor, and other coding agents for GitHub Actions, GitLab, and preview deploys. It picks thresholds from a baseline run of squirrelscan audit rules, fails builds on a score threshold, error findings, or new findings, and handles the exit codes correctly. Use when asked "add squirrelscan to GitHub Actions", "fail CI on website audit errors", or "gate preview deploys on audit scores".
npx skill4agent add squirrelscan/skills website-ci-gateaudit-websitesquirrel --versionsquirrelscanreferences/install.mdsquirrel auth status--offlinesquirrel credits--offline--no-publish--ephemeralhttps://docs.squirrelscan.com/rules/{category}/{rule_id}SQUIRRELSCAN_API_KEY--httpsquirrel audit https://staging.example.com --level quick --format json -o baseline.json--fail-on<>squirrel audit "$URL" --level quick --format json -o report.json \
--fail-on 'score<85' --fail-on 'score:perf<70' --fail-on 'severity>=error'| Expression | Trips when |
|---|---|
| overall health score is below N |
| a category score is below N, for example |
| any error-severity finding |
| any warning-severity finding (also counts a security rule that timed out) |
squirrel ci <url> --website <id> --fail-on-new erroraudits:readaudits:writeSQUIRRELSCAN_API_KEY--rule-includesecurity,links--rule-exclude[[ignore]]squirrel.toml| Code | Meaning | Pipeline |
|---|---|---|
| Ran, every threshold passed | pass |
| A threshold tripped | fail the job |
| Operational error: bad flags, a crash, a site that answered with an error | fail, and read the message |
| The page was blocked by a WAF or bot manager: nothing was audited | fail or alert, never pass |
| The start URL redirected to another site | fail: fix the URL |
| The start URL could not be reached | fail: the preview may not be up yet |
2345name: Site audit
on: [pull_request]
jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: squirrelscan/audit-action@v1
with:
url: https://staging.example.com
fail-on: "score<85,severity>=error"
token: ${{ secrets.SQUIRRELSCAN_API_KEY }} # optional - run: |
curl -fsSL --connect-timeout 10 --max-time 120 https://install.squirrelscan.com | bash
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- run: squirrel audit "$URL" --level quick --fail-on 'score<85' --fail-on 'severity>=error'
env:
URL: https://staging.example.com
SQUIRRELSCAN_API_KEY: ${{ secrets.SQUIRRELSCAN_API_KEY }}script:SQUIRRELSCAN_API_KEYgithub.event.deployment_status.environment_urldeployment_status--refreshaudit-websitesecurity-auditseo-auditperformance-auditaccessibility-audit