Update main.yml #4
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 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 }} |