Skip to content

feat: snyk pipeline #41

feat: snyk pipeline

feat: snyk pipeline #41

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
id: snyk
run: |
echo "::set-output name=report::$(npx snyk test --severity-threshold=high --json)"
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
- name: Send Snyk report
if: always()
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: ${{steps.snyk.outputs.report}}