-
Notifications
You must be signed in to change notification settings - Fork 6
45 lines (38 loc) · 1.46 KB
/
sample.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
name: CI/CD Pipeline
on:
push:
branches: [dev]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Trivy
run: |
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
echo "deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main" | sudo tee -a /etc/apt/sources.list.d/trivy.list
sudo apt-get update
sudo apt-get install trivy
pwd
- name: Scan files with Trivy
run: |
trivy fs . > trivy-files.txt
ls -lah
- name: Send scan reports via email
run: |
echo "Scan report attached." > body.txt
echo "From: [email protected]" > email.txt
echo "To: [email protected]" >> email.txt
echo "Subject: Trivy Scan Report" >> email.txt
echo "Content-Type: text/plain; charset=UTF-8" >> email.txt
echo "" >> email.txt
cat body.txt >> email.txt
sudo apt-get update
sudo apt-get install -y mutt
mutt -s "Trivy Scan Report" -a /home/runner/work/rc-ewallet/rc-ewallet/trivy-files.txt -- [email protected] < email.txt
env:
SMTP_SERVER: smtp.gmail.com
SMTP_PORT: 465
SMTP_USERNAME: [email protected]
SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }}