Skip to content

Commit b4f6c7e

Browse files
Create trivy-analysis.yml
1 parent 8049a6b commit b4f6c7e

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: build
2+
on:
3+
push:
4+
branches: [ main ]
5+
pull_request:
6+
jobs:
7+
build:
8+
name: Build
9+
runs-on: "ubuntu-18.04"
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v2
13+
14+
- name: Build an image from Dockerfile
15+
run: |
16+
docker build -t ghcr.io/naveensrinivasna/k8s-namespace-operator:${{ github.sha }} .
17+
18+
- name: Run Trivy vulnerability scanner
19+
uses: aquasecurity/trivy-action@master
20+
with:
21+
image-ref: 'docker.io/my-organization/my-app:${{ github.sha }}'
22+
format: 'template'
23+
template: '@/contrib/sarif.tpl'
24+
output: 'trivy-results.sarif'
25+
severity: 'CRITICAL,HIGH'
26+
27+
- name: Upload Trivy scan results to GitHub Security tab
28+
uses: github/codeql-action/upload-sarif@v1
29+
with:
30+
sarif_file: 'trivy-results.sarif'

0 commit comments

Comments
 (0)