Skip to content

Update main.yml

Update main.yml #4

Workflow file for this run

name: Snyk Open Source Scans
concurrency:
group: snyk-opensource-actions-${{ github.ref }}
cancel-in-progress: true
on:
merge_group:
branches: [checks_requested]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
build-and-test: # Combined job name
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm' # Enable caching for efficiency
- name: Install dependencies
run: npm install # Assuming npm is your package manager
- name: Run tests
run: npm test # Replace with your actual test command
- name: Install Snyk
run: npm install --location=global snyk@latest
- name: Authenticate Snyk
run: snyk auth ${{ secrets.SNYK_TOKEN }}
- name: Snyk Open Source Scan
run: snyk test --org=${{ secrets.SNYK_ORG }} --all-projects
- name: Snyk Monitor (Optional) # Uncomment for continuous monitoring
# run: snyk monitor --org=${{ secrets.SNYK_ORG }}