Skip to content

Commit 47ee2f5

Browse files
committed
Create snyk-container.yml
1 parent 5682f45 commit 47ee2f5

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/snyk-container.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# A sample workflow which checks out the code, builds a container
7+
# image using Docker and scans that image for vulnerabilities using
8+
# Snyk. The results are then uploaded to GitHub Security Code Scanning
9+
#
10+
# For more examples, including how to limit scans to only high-severity
11+
# issues, monitor images for newly disclosed vulnerabilities in Snyk and
12+
# fail PR checks for new vulnerabilities, see https://github.com/snyk/actions/
13+
14+
name: Snyk Container
15+
16+
on:
17+
push:
18+
branches: [ main ]
19+
pull_request:
20+
# The branches below must be a subset of the branches above
21+
branches: [ main ]
22+
schedule:
23+
- cron: '37 23 * * 0'
24+
25+
jobs:
26+
snyk:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v3
30+
- name: Build a Docker image
31+
run: docker build -t your/image-to-test .
32+
- name: Run Snyk to check Docker image for vulnerabilities
33+
# Snyk can be used to break the build when it detects vulnerabilities.
34+
# In this case we want to upload the issues to GitHub Code Scanning
35+
continue-on-error: true
36+
uses: snyk/actions/docker@14818c4695ecc4045f33c9cee9e795a788711ca4
37+
env:
38+
# In order to use the Snyk Action you will need to have a Snyk API token.
39+
# More details in https://github.com/snyk/actions#getting-your-snyk-token
40+
# or you can signup for free at https://snyk.io/login
41+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
42+
with:
43+
image: your/image-to-test
44+
args: --file=Dockerfile
45+
- name: Upload result to GitHub Code Scanning
46+
uses: github/codeql-action/upload-sarif@v2
47+
with:
48+
sarif_file: snyk.sarif

0 commit comments

Comments
 (0)