Skip to content

Commit

Permalink
feat: snyk pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
DevRico003 committed Feb 28, 2024
1 parent a16bd33 commit f12e9cf
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,14 @@ jobs:
# run: npm test

- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/node@master
id: snyk
run: |
echo "::set-output name=report::$(npx snyk test --severity-threshold=high --json)"
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()
if: always()
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com
Expand All @@ -50,4 +45,4 @@ jobs:
subject: Snyk Report
to: ${{secrets.MAIL}}
from: ${{secrets.MAIL_USERNAME}}
body: ${{join('', steps.read.outputs.text)}}
body: ${{steps.snyk.outputs.report}}

0 comments on commit f12e9cf

Please sign in to comment.