ci(fix): Attempt to fix release.yml (#2293) #3180
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image Scan | |
on: | |
push: | |
branches: [ main ] | |
tags: [ 'v*' ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
image-scan: | |
permissions: | |
security-events: write | |
runs-on: ubuntu-latest | |
env: | |
DOCKER_BUILDKIT: 1 | |
DOCKER_CLI_EXPERIMENTAL: enabled | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Quick build (linux/alpine only) | |
run: | | |
docker build --target gomplate-alpine -t gomplate . | |
- name: Install Trivy | |
uses: aquasecurity/[email protected] | |
with: | |
version: v0.57.0 | |
cache: true | |
- name: Download Trivy DB | |
run: | | |
trivy fs --no-progress --download-db-only --db-repository public.ecr.aws/aquasecurity/trivy-db | |
- name: Run Trivy vulnerability scanner (table output) | |
run: | | |
trivy image \ | |
--scanners vuln \ | |
--format table \ | |
--exit-code 1 \ | |
--ignore-unfixed \ | |
--pkg-types os,library \ | |
--severity CRITICAL,HIGH \ | |
--skip-db-update \ | |
gomplate | |
- name: Run Trivy vulnerability scanner | |
run: | | |
trivy image \ | |
--scanners vuln \ | |
--format sarif \ | |
--output trivy-results.sarif \ | |
--ignore-unfixed \ | |
--pkg-types os,library \ | |
--ignorefile .trivyignore \ | |
--skip-db-update \ | |
gomplate | |
if: always() && github.repository == 'hairyhenderson/gomplate' | |
- name: Upload Trivy scan results to GitHub Security tab | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: 'trivy-results.sarif' | |
if: always() && github.repository == 'hairyhenderson/gomplate' |