Skip to main content
Version: Latest

Troubleshooting

Quick Diagnosis

SymptomLikely CauseFix
Everything marked "new"Missing baselineMount /main, set CODEWARD_MODE=diff
No PR commentMissing env varsSet CODEWARD_GITHUB_TOKEN, PR_NUMBER, OWNER, REPOSITORY
Empty reportWrong change filterInclude new in changes
Template error with JSONtemplate set for JSONRemove template field
Invalid field errorWrong field for policy typeCheck Policies
Relationship filter ignoredDependency tree disabledSet global.dependency_tree: true
Rule not workingMisunderstood rule logicRules find problems, not enforce requirements

Rule Logic

Common confusion: Rules define what to search for, not requirements.

What You WantCorrect Rule
Find CRITICAL vulns{ type: eq, value: CRITICAL }
Find large PRs (>30 files){ type: gt, value: "30" }
Find missing test script{ type: not_exists, key: scripts.test }
Find WIP PRs{ type: contains, value: WIP }
Find Dockerfiles without USER{ type: not_contains, value: USER }

Think: ✅ "Find what I want to block" — not ❌ "Define requirements".

Docker Volumes

MountPurposeRequired
/mainMain/base branchYes
/branchFeature branchOnly for diff mode
/resultsOutput filesIf using file: destinations
/.cacheTrivy DB + license cacheRecommended

Validation Errors

ErrorFix
invalid formatUse markdown, html, or json
invalid destinationStart with git:, log:, file:, or url:
template must be emptyRemove template for JSON outputs
invalid fieldUse only allowed fields for the policy type
webhook only valid on url: destinationsMove webhook config to a url: output

Performance Tips

  1. Persistent cache — mount /.cache to avoid re-downloading trivy-db
  2. Install dependencies — run npm ci, pip install before scanning
  3. Air-gapped mode — set TRIVY_SKIP_DB_UPDATE=true with pre-cached DB
  4. Limit glob scope — narrow file patterns reduce scan time
  5. Pin image versions — use ghcr.io/codeward-io/scan:v0.3.0

Exit Codes

CodeMeaning
0Success — no blocking findings
1Failure — block action triggered, or fatal error

Security Notes

  • All scanning runs inside the container — no code leaves the runner
  • Outputs go only to configured destinations
  • No external calls except trivy-db updates and your url: destinations
  • Use repository-scoped tokens with minimal permissions
  • Grant only: contents: read, packages: read, pull-requests: write, issues: write