Skip to content

Commit

Permalink
Testing Snyk Vulnerability Scan fix
Browse files Browse the repository at this point in the history
  • Loading branch information
grebois committed May 22, 2024
1 parent 70a18f4 commit 0a8814b
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 10 deletions.
70 changes: 60 additions & 10 deletions .github/workflows/snyk.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,82 @@
#name: Snyk Vulnerability Scan
#
#on:
# push:
# branches:
# - development
# pull_request:
# branches:
# - development
#
#jobs:
# snyk-security:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
#
# - name: Set up Go
# uses: actions/setup-go@v2
# with:
# go-version: '1.22.3' # Specify the Go version you need
#
# - name: Install Go dependencies
# run: go mod tidy
#
# - name: Run Snyk to check for vulnerabilities
# uses: snyk/actions/golang@master
# with:
# args: test --org=$SNYK_ORG --severity-threshold=high
# env:
# SNYK_ORG: ${{ secrets.SNYK_ORG }}
# SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

name: Snyk Vulnerability Scan

on:
push:
branches:
- development
- feat/doc
pull_request:
branches:
- development

jobs:
snyk-security:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Install Node.js dependencies
run: |
cd web
npm install --legacy-peer-deps --force
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: '1.22.3' # Specify the Go version you need
go-version: '1.16'

- name: Install Go dependencies
run: go mod tidy

- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/golang@master
with:
args: test --org=$SNYK_ORG --severity-threshold=high
- name: Install Snyk
run: npm install -g snyk

- name: Authenticate Snyk
env:
SNYK_ORG: ${{ secrets.SNYK_ORG }}
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
run: snyk auth $SNYK_TOKEN

- name: Run Snyk test
env:
SNYK_ORG: ${{ secrets.SNYK_ORG }}
run: snyk test --org=$SNYK_ORG --severity-threshold=high --all-projects
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:16 as builder

ADD . /app
WORKDIR /app/web
RUN npm install --legacy-peer-deps --force

FROM snyk/snyk:golang

ENV SNYK_TOKEN 41b6acca-3c7b-4726-bb9b-bc7925c68d16

COPY --from=Builder /app /app

RUN go mod tidy

RUN snyk test --org=fluidity-labs --severity-threshold=high --all-projects

0 comments on commit 0a8814b

Please sign in to comment.