Update snyk-security.yml #3
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: Snyk Security Scan | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
permissions: | |
contents: read | |
jobs: | |
snyk: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
# Set up Node.js environment (adjust version as necessary) | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
# Install dependencies | |
- name: Install dependencies | |
run: npm install | |
# Snyk Code and Package Scanning | |
- name: Run Snyk to check for vulnerabilities | |
uses: snyk/actions/node@master | |
env: | |
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | |
with: | |
args: --severity-threshold=high | |
# Docker build | |
- name: Build Docker image | |
run: docker build -t your-image-name . | |
# Snyk Docker Scanning | |
- name: Snyk Container monitor | |
run: snyk container monitor your-image-name --file=Dockerfile | |
# Upload results to GitHub Code Scanning | |
- name: Upload Snyk scan results to GitHub Code Scanning | |
uses: github/codeql-action/upload-sarif@v2 | |
with: | |
sarif_file: snyk.sarif |