Skip to content

feat: snyk pipeline #40

feat: snyk pipeline

feat: snyk pipeline #40

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches:
- main
jobs:
build_test_security_notify:
runs-on: ubuntu-latest
environment: Production
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
# - name: Run tests
# run: npm test
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/node@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --severity-threshold=high --json > snyk_report.json
- name: Prepare Snyk report
run: |
echo "Snyk report:" > mail_body.txt
cat snyk_report.json >> mail_body.txt
- name: Send Snyk report
if: failure()
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com
server_port: 465
username: ${{secrets.MAIL_USERNAME}}
password: ${{secrets.MAIL_PASSWORD}}
subject: Snyk Report
to: ${{secrets.MAIL}}
from: ${{secrets.MAIL_USERNAME}}
body: ${{join('', steps.read.outputs.text)}}