-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (64 loc) · 1.56 KB
/
checks-image.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
66
67
68
69
70
71
72
name: "Checks (Image)"
concurrency:
group: checks-image-${{ github.repository }}-${{ github.ref }}
on:
pull_request:
branches:
- 'master'
- 'releases/**'
paths-ignore:
- '.github/**'
- '.gitignore'
- 'LICENSE'
- '**.md'
push:
branches:
- 'master'
- 'releases/**'
paths-ignore:
- '.github/**'
- '.gitignore'
- 'LICENSE'
- '**.md'
env:
FILE_PATH: "Containerfile"
jobs:
lint-scan:
name: Lint/scan image
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
fetch-depth: 1
path: .
- name: Set up Buildx
uses: docker/setup-buildx-action@v3
- name: Build image
uses: docker/build-push-action@v5
with:
context: .
file: "${{ env.FILE_PATH }}"
load: true
push: false
tags: app-image:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Lint with Dockle
uses: erzz/dockle-action@v1
with:
image: app-image:${{ github.sha }}
exit-code: 1
failure-threshold: FATAL
timeout: "10m"
- name: Scan with Trivy
continue-on-error: true
uses: aquasecurity/trivy-action@master
with:
image-ref: app-image:${{ github.sha }}
format: 'table'
exit-code: '0'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
timeout: "10m"