Skip to content

[Snyk] Fix for 1 vulnerabilities #542

[Snyk] Fix for 1 vulnerabilities

[Snyk] Fix for 1 vulnerabilities #542

Workflow file for this run

name: Unit Tests and Analysis
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: Unit Tests
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
runs-on: ubuntu-22.04
steps:
- uses: bcgov-nr/[email protected]
with:
commands: |
npm ci
npm run test-unit
dir: api
sonar_args: >
-Dsonar.exclusions=**/test/**/*,.github/**/*,**/migrations/**/*
-Dsonar.javascript.lcov.reportPaths=coverage/api/lcov.info
-Dsonar.organization=bcgov-sonarcloud
-Dsonar.project.monorepo.enabled=false
-Dsonar.projectKey=nr-fom
sonar_project_token: ${{ secrets.SONAR_TOKEN }}
# https://github.com/marketplace/actions/aqua-security-trivy
trivy:
name: Trivy Security Scan
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/[email protected]
with:
format: "sarif"
output: "trivy-results.sarif"
ignore-unfixed: true
scan-type: "fs"
security-checks: "vuln,secret,config"
severity: "CRITICAL,HIGH"
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: "trivy-results.sarif"