chore: applly image scan#25
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the GitHub Actions CI/CD workflows to incorporate Trivy image scanning into the deployment pipeline and to simplify the existing Trivy+Go test workflow.
Changes:
- Removed PR-commenting steps (and elevated PR permissions) from the Trivy + Go tests workflow.
- Updated the deployment workflow to build the Docker image locally, run a Trivy image scan, then push the image if the scan passes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/trivy-go-tests.yaml | Removes PR comment/report steps and reduces permissions; keeps Trivy FS scan + Go unit test execution. |
| .github/workflows/deployment.yaml | Splits build/push into build → Trivy image scan → push to enforce vulnerability gating before publish. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ignore-unfixed: true | ||
| format: 'table' | ||
| output: 'trivy-results.txt' | ||
| severity: 'CRITICAL,HIGH,MEDIUM,LOW' | ||
| exit-code: '1' | ||
| exit-code: '1' |
| - name: Run Trivy vulnerability scanner on image | ||
| if: ${{ inputs.deploy_type != 'release-only' }} | ||
| uses: aquasecurity/trivy-action@0.35.0 | ||
| with: | ||
| scan-type: 'image' | ||
| image-ref: ${{ secrets.GCP_REGISTRY }}/${{ secrets.GCP_PROJECT }}/${{ inputs.image_path }}:latest | ||
| ignore-unfixed: true | ||
| format: 'table' | ||
| severity: 'CRITICAL,HIGH' | ||
| exit-code: '1' |
| format: 'table' | ||
| output: 'trivy-results.txt' | ||
| severity: 'CRITICAL,HIGH,MEDIUM,LOW' |
There was a problem hiding this comment.
The
output: 'trivy-results.txt' parameter redirects Trivy results to a file instead of stdout. The PR comment step that previously surfaced this file was removed, and no artifact-upload step replaced it. When the scan fails with exit-code: '1', developers will see the job fail but have no way to see which vulnerabilities triggered it — the results file is silently discarded at the end of the runner. Either remove output (letting results print to the workflow log) or add an actions/upload-artifact step so the file is retrievable.
| format: 'table' | |
| output: 'trivy-results.txt' | |
| severity: 'CRITICAL,HIGH,MEDIUM,LOW' | |
| format: 'table' | |
| severity: 'CRITICAL,HIGH,MEDIUM,LOW' |
Summary
Why
QA Report
Integration Tests
Added
Edited
Dependencies