Trivy Docker Image Scan #1481
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: Trivy Docker Image Scan | |
on: | |
schedule: | |
# 4am in UTC time. | |
- cron: '0 4 * * *' | |
push: | |
branches: | |
- '*' | |
paths: | |
- 'base/base-image/*' | |
pull_request: | |
branches: | |
- '*' | |
paths: | |
- 'base/base-image/*' | |
jobs: | |
build: | |
name: Trivy Docker Image Scan | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Build an image from Dockerfile | |
run: | | |
docker build --no-cache=true -t ballerina/jre11:v1 ./base/base-image | |
- name: Run Trivy vulnerability scanner | |
uses: aquasecurity/trivy-action@master | |
with: | |
image-ref: 'ballerina/jre11:v1' | |
format: 'table' | |
exit-code: '1' | |
ignore-unfixed: true | |
severity: 'HIGH' |