docker-scan #128
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |