Skip to content

Commit 0d0b9fa

Browse files
authored
Merge pull request #5 from sitespeedio/scan
Add docker scan
2 parents f54bb85 + df904d4 commit 0d0b9fa

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/docker-scan.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Docker security scan
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
jobs:
8+
build:
9+
name: Build
10+
runs-on: ubuntu-20.04
11+
if: ${{ !contains(github.event.head_commit.message, 'docs:') }}
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Build an image from Dockerfile
17+
run: |
18+
docker buildx install
19+
docker buildx build --load --platform linux/amd64 -t docker.io/sitespeedio/node:${{ github.sha }} .
20+
21+
- name: Run Trivy vulnerability scanner
22+
uses: aquasecurity/trivy-action@master
23+
with:
24+
image-ref: 'docker.io/sitespeedio/node:${{ github.sha }}'
25+
format: 'table'
26+
exit-code: '1'
27+
ignore-unfixed: true
28+
vuln-type: 'os,library'
29+
severity: 'CRITICAL'

0 commit comments

Comments
 (0)