Update sample.yml #2
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: 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 | |
- name: Scan files with Trivy | |
run: | | |
trivy fs . > trivy-files.txt | |
# Assuming Trivy is already installed in the system | |
- name: Install dependencies and build | |
run: | | |
npm install | |
npm run build | |
- name: Send scan reports via email | |
run: | | |
echo "Scan report attached." | mail -s "Trivy Scan Report" -A trivy-files.txt [email protected] |