Skip to content

Commit

Permalink
Add CircleCI Snyk Code to HTML Example (#81)
Browse files Browse the repository at this point in the history
* Create config-code-scan-html.yml

* Create config-opensource.yml

* reorganize CircleCI folder
  • Loading branch information
dylansnyk authored Apr 2, 2024
1 parent f992181 commit 4af7143
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
40 changes: 40 additions & 0 deletions CircleCI/config-code-scan-html.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: 2.1
orbs:
snyk: snyk/[email protected]

jobs:
build-and-test:
docker:
- image: cimg/openjdk:11.0
steps:
- checkout
- run:
name: Build
command: mvn -B -DskipTests clean package
- run:
name: Test
command: mvn test
snyk-scan:
docker:
- image: cimg/openjdk:11.0-node
steps:
- checkout
- run:
name: Install Snyk to HTML
command: npm install --prefix=$HOME/.local -g snyk-to-html
- snyk/scan:
monitor-on-build: false
fail-on-issues: false
command: code test
additional-arguments: --json-file-output=code-results.json
- run:
name: Generate Snyk HTML report
command: cat code-results.json | snyk-to-html -o code-report.html
- store_artifacts:
path: code-report.html

workflows:
build-test-snyk:
jobs:
- build-and-test
- snyk-scan
19 changes: 19 additions & 0 deletions CircleCI/config-opensource.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2.1
orbs:
snyk: snyk/[email protected]

jobs:
snyk-scan:
docker:
- image: cimg/openjdk:11.0
steps:
- checkout
- run: mvn install
- snyk/scan:
command: monitor
monitor-on-build: false

workflows:
build-test-snyk:
jobs:
- snyk-scan
File renamed without changes.
File renamed without changes.

0 comments on commit 4af7143

Please sign in to comment.