Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update main.yml
  • Loading branch information
DefenderK authored Apr 15, 2025
commit bb4f40de7337b594c06bf932377a16ea2a4d8828
23 changes: 13 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
name: "Snyk Scan"

on:
push:
branches:
- 'demo*' # Include any branch starting with demo

jobs:
Pipeline-Job:
# Configure Environment
name: 'Snyk Scan'
runs-on: ubuntu-latest
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

steps:
# Checkout Code
- name: Checkout Code
uses: actions/checkout@v1

# Install and Authenticate to Snyk
- name: Install Snyk & Authenticate
run: |
sudo npm install -g snyk
snyk auth ${SNYK_TOKEN}

# Run Snyk Code and Generate SARIF
# Run Snyk Code and Generate SARIF - with all issues
- name: Run Snyk Code and Generate SARIF
run: |
snyk code test --sarif-file-output=snyk.sarif --fail-on=critical # or --fail-on=critical or --fail-on=high,critical
# Run with all issues captured for SARIF output
snyk code test --json --sarif-file-output=snyk.sarif || echo "Issues found, but continuing"
continue-on-error: true

# Upload SARIF to GitHub Code Scanning.

# Run Snyk Code with critical threshold for pipeline status
- name: Run Snyk Code with Critical Threshold
run: |
# Run with critical severity threshold for pass/fail status
snyk code test --severity-threshold=critical

# Upload SARIF to GitHub Code Scanning
- name: Upload SARIF to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: snyk.sarif

Loading