-
Notifications
You must be signed in to change notification settings - Fork 1.5k
65 lines (63 loc) · 1.58 KB
/
ci-aqua-security-trivy-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: ci-aqua-security-trivy-tests
on:
pull_request:
paths-ignore:
- '.github/CODEOWNERS'
- '.vscode/**'
- 'compose/**'
- 'contrib/systemd/**'
- 'licenses/**'
- 'paper/**'
- 'present/**'
- 'RFC/**'
- 'static/**'
- 'wiki/**'
- '**/**.dockerignore'
- '**/**.gitignore'
- '**/**.md'
- '**/**.png'
- '**/**.jpg'
- '**/**.gif'
- '**/**.ini'
types:
- opened
- reopened
- synchronize
- ready_for_review
branches:
- main
- 'release/**'
schedule:
- cron: "0 0 * * *"
permissions:
security-events: write
jobs:
build:
name: trivy-tests
if: github.event.pull_request.draft == false
runs-on: warp-ubuntu-latest-x64-4x
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get Go Version
run: |
#!/bin/bash
GOVERSION=$({ [ -f .go-version ] && cat .go-version; })
echo "GOVERSION=$GOVERSION" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GOVERSION }}
- name: Build Docker image
run: |
make docker-image
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'dgraph/dgraph:local'
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'