Skip to content

Commit

Permalink
Create SnykOpenSourceScans.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Sameer515 authored Dec 16, 2024
1 parent 45a0cff commit 3f75131
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/SnykOpenSourceScans.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Snyk Open Source Scans
concurrency:
group: snyk-opensource-actions-${{ github.ref }}
cancel-in-progress: true
on:
merge_group:
types: [checks_requested]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
snyk-opensource-pipeline:
runs-on: ubuntu-22.04
name: Snyk Open Source Diff Scan
env:
SNYK_TOKEN: ${{ secrets.SNYK_GH_ACTIONS_TOKEN }}
SNYK_ORG: ${{ vars.SNYK_ORG }}

steps:
# Checkout base ref branch
- uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}
- uses: actions/setup-python@v5
with:
python-version: '3.10'
# cache: 'pip' # Uncomment if using requirements.txt
# - run: pip install -r requirements.txt # Uncomment if using requirements.txt
- name: Download Snyk
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install snyk
run: npm install --location=global snyk@latest

- name: Install snyk-delta # No longer needed
# run: npm install --location=global snyk-delta@latest

# - name: Install snyk_delta_all_projects.sh # No longer needed
# run: |
# wget -O snyk_delta_all_projects.sh https://raw.githubusercontent.com/snyk-tech-services/snyk-delta/refs/heads/develop/snyk_delta_all_projects.sh
# mv ./snyk_delta_all_projects.sh /usr/local/bin/

- name: Install jq
run: npm install --location=global node-jq

- name: Authenticate Snyk
run: snyk auth ${SNYK_TOKEN}

- name: Run Snyk Open Source and diff
run: snyk test --org=${SNYK_ORG} --all-projects

# - name: Run snyk monitor # Uncomment if using snyk/actions/node
# uses: snyk/actions/node@master
# with:
# command: monitor
# args: --all-projects --detection-depth=2 --org=${SNYK_ORG} --severity=high
# run: snyk monitor --all-projects --detection-depth=2 --org=${SNYK_ORG}

0 comments on commit 3f75131

Please sign in to comment.