diff --git a/.github/workflows/snyk_sca_scan.yaml b/.github/workflows/snyk_sca_scan.yaml index 25e77d94b..eb88f1847 100644 --- a/.github/workflows/snyk_sca_scan.yaml +++ b/.github/workflows/snyk_sca_scan.yaml @@ -18,8 +18,8 @@ jobs: with: node-version: ${{ matrix.node-version }} - name: Run Snyk to check for opensource vulnerabilities - uses: snyk/actions/node@master + uses: snyk/actions/setup@master + run: | + snyk test --all-projects --strict-out-of-sync=false --detection-depth=6 --exclude=docker,Dockerfile --severity-threshold=critical env: SNYK_TOKEN: ${{ secrets.SNYK_API_TOKEN }} - with: - args: --all-projects --strict-out-of-sync=false --detection-depth=6 --exclude=docker,Dockerfile --severity-threshold=critical \ No newline at end of file diff --git a/task-utils.js b/task-utils.js index cd4360c16..7e39cfdef 100644 --- a/task-utils.js +++ b/task-utils.js @@ -62,6 +62,16 @@ function readNycOptions(workingDirectory) { } } + const nycConfigCommonJsFilename = join(workingDirectory, 'nyc.config.cjs') + let nycConfigCommonJs = {} + if (existsSync(nycConfigCommonJsFilename)) { + try { + nycConfigCommonJs = require(nycConfigCommonJsFilename) + } catch (error) { + throw new Error(`Failed to load nyc.config.cjs: ${error.message}`) + } + } + const nycOptions = combineNycOptions( defaultNycOptions, nycrc, @@ -69,6 +79,7 @@ function readNycOptions(workingDirectory) { nycrcYaml, nycrcYml, nycConfig, + nycConfigCommonJs, pkgNycOptions ) debug('combined NYC options %o', nycOptions)