Interview Prep/CI/CD/GitHub Actions and GitLab CI in Production

How do you deploy only when images pass vulnerability scanning in GitHub Actions?

IntermediateProductionGitHub Actions and GitLab CI in Production
Answer

Scan the built image before pushing it to the trusted registry or promote it only after the scan: Trivy fails the job on findings above the threshold, and the deploy job needs the scan job.

- uses: aquasecurity/[email protected]
  with:
    image-ref: ghcr.io/acme/shop-api:${{ github.sha }}
    severity: CRITICAL,HIGH
    ignore-unfixed: true
    exit-code: '1'

Maintain an expiring exceptions file (.trivyignore with justification and date) rather than lowering the threshold globally.

All CI/CD questions Roadmap: GitLab CI/CD

More on GitHub Actions and GitLab CI in Production