-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from iuriikogan-snyk/iuriikogan-patch-9
Update snyk-test.yaml
- Loading branch information
Showing
1 changed file
with
54 additions
and
54 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,66 @@ | ||
name: Snyk Scan | ||
# name: Snyk Scan | ||
|
||
on: | ||
workflow_dispatch: | ||
# workflow_run: | ||
# workflows: ["Ensure Snyk Policy Version"] | ||
# types: | ||
# - completed | ||
env: | ||
IMAGE_NAME: nodejs-goof | ||
# on: | ||
# workflow_dispatch: | ||
# # workflow_run: | ||
# # workflows: ["Ensure Snyk Policy Version"] | ||
# # types: | ||
# # - completed | ||
# env: | ||
# IMAGE_NAME: nodejs-goof | ||
|
||
jobs: | ||
build: | ||
name: Snyk Scan | ||
runs-on: ubuntu-latest | ||
# jobs: | ||
# build: | ||
# name: Snyk Scan | ||
# runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [20.x] | ||
continue-on-error: true | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# strategy: | ||
# matrix: | ||
# node-version: [20.x] | ||
# continue-on-error: true | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
# - name: Use Node.js ${{ matrix.node-version }} | ||
# uses: actions/setup-node@v2 | ||
# with: | ||
# node-version: ${{ matrix.node-version }} | ||
# cache: 'npm' | ||
|
||
- name: Build project | ||
run: npm ci --legacy-peer-deps | ||
# - name: Build project | ||
# run: npm ci --legacy-peer-deps | ||
|
||
- name: Setup Snyk + snyk-filter # For information about the required commands https://docs.snyk.io/scm-ide-and-ci-cd-integrations/snyk-ci-cd-integrations | ||
run: | | ||
npm install snyk snyk-filter -g | ||
snyk auth ${{ secrets.SNYK_TOKEN }} | ||
# - name: Setup Snyk + snyk-filter # For information about the required commands https://docs.snyk.io/scm-ide-and-ci-cd-integrations/snyk-ci-cd-integrations | ||
# run: | | ||
# npm install snyk snyk-filter -g | ||
# snyk auth ${{ secrets.SNYK_TOKEN }} | ||
|
||
- name: Snyk Open Source | ||
run: snyk test --json | snyk-filter # --json --print-deps | snyk-delta --setPassIfNoBaseline false | ||
# run: snyk monitor --org=XXX ---project-name=XXX - Use snyk monitor command to upload the results to the UI | ||
continue-on-error: true | ||
# - name: Snyk Open Source | ||
# run: snyk test --json | snyk-filter # --json --print-deps | snyk-delta --setPassIfNoBaseline false | ||
# # run: snyk monitor --org=XXX ---project-name=XXX - Use snyk monitor command to upload the results to the UI | ||
# continue-on-error: true | ||
|
||
- name: Snyk Code | ||
run: snyk code test | ||
continue-on-error: true | ||
# - name: Snyk Code | ||
# run: snyk code test | ||
# continue-on-error: true | ||
|
||
- name: Snyk Container | ||
run: | | ||
docker build . -t ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }} | ||
snyk container test ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }} --file=Dockerfile --exclude-app-vulns --platform=linux/amd64 | ||
# Rename your image, for uploading directly to your snyk org please use the command "snyk container monitor $container_name/$tag --org=$ORG_ID" | ||
continue-on-error: true | ||
# - name: Snyk Container | ||
# run: | | ||
# docker build . -t ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }} | ||
# snyk container test ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }} --file=Dockerfile --exclude-app-vulns --platform=linux/amd64 | ||
# # Rename your image, for uploading directly to your snyk org please use the command "snyk container monitor $container_name/$tag --org=$ORG_ID" | ||
# continue-on-error: true | ||
|
||
- name: Snyk IaC | ||
run: snyk iac test | ||
continue-on-error: true | ||
# - name: Snyk IaC | ||
# run: snyk iac test | ||
# continue-on-error: true | ||
|
||
- name: Snyk SBOM generate | ||
run: snyk sbom --format=cyclonedx1.4+json --name=nodejs=goof --all-projects > bom.cyclonex1-4.json | ||
continue-on-error: true | ||
# - name: Snyk SBOM generate | ||
# run: snyk sbom --format=cyclonedx1.4+json --name=nodejs=goof --all-projects > bom.cyclonex1-4.json | ||
# continue-on-error: true | ||
|
||
- name: Upload a Build Artifact | ||
uses: actions/upload-artifact@v4.3.5 | ||
with: | ||
name: snyk SBOM | ||
path: bom.cyclonex1-4.json | ||
# - name: Upload a Build Artifact | ||
# uses: actions/upload-artifact@v4.3.5 | ||
# with: | ||
# name: snyk SBOM | ||
# path: bom.cyclonex1-4.json |