-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (37 loc) · 1.1 KB
/
docker-scan.yaml
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
name: docker-scan
on:
schedule:
- cron: '30 2 * * *'
env:
REGISTRY: docker.io
IMAGE_NAME: 42crunch/scand-manager
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Scan image
id: scan
uses: Azure/container-scan@v0
with:
image-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
severity-threshold: CRITICAL
run-quality-checks: true
-
name: Send mail
if: failure()
run: |
cat <<EOF > email.txt
From: No Reply <[email protected]>
To: Security <[email protected]>
Subject: Container Scan Report of ${{ github.repository }}
Date: $(date)
$(cat ${{ steps.scan.outputs.scan-report-path }})
$(cat ${{ steps.scan.outputs.check-run-url }})
EOF
curl \
--ssl-reqd smtp://smtp.gmail.com \
--mail-from [email protected] \
--mail-rcpt [email protected] \
--upload-file email.txt \
--user ${{ secrets.MAIL_USERNAME }}:${{ secrets.MAIL_PASSWORD }}