Skip to content

Commit

Permalink
Merge pull request #73 from iuriikogan-snyk/iuriikogan-patch-9
Browse files Browse the repository at this point in the history
Update snyk-test.yaml
  • Loading branch information
iuriikogan authored Sep 24, 2024
2 parents 4208f46 + 52a814e commit 8f2a72e
Showing 1 changed file with 54 additions and 54 deletions.
108 changes: 54 additions & 54 deletions .github/workflows/snyk-test.yaml
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

0 comments on commit 8f2a72e

Please sign in to comment.