Skip to content

Commit 801ec4b

Browse files
authored
feat: Add snyk container analysis every month
1 parent 0ea07e1 commit 801ec4b

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Snyk Container
2+
3+
on:
4+
push:
5+
branches: [ "main", v*.*.* ]
6+
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [ "main" ]
9+
schedule:
10+
- cron: '00 16 1 * *'
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
snyk:
17+
permissions:
18+
contents: read # for actions/checkout to fetch code
19+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
20+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v3
24+
- name: Build a Docker image
25+
run: docker build -t appsinet/php_development .
26+
- name: Run Snyk to check Docker image for vulnerabilities
27+
# Snyk can be used to break the build when it detects vulnerabilities.
28+
# In this case we want to upload the issues to GitHub Code Scanning
29+
continue-on-error: true
30+
uses: snyk/actions/docker@14818c4695ecc4045f33c9cee9e795a788711ca4
31+
env:
32+
# In order to use the Snyk Action you will need to have a Snyk API token.
33+
# More details in https://github.com/snyk/actions#getting-your-snyk-token
34+
# or you can signup for free at https://snyk.io/login
35+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
36+
with:
37+
image: appsinet/php_development
38+
args: --file=Dockerfile
39+
- name: Upload result to GitHub Code Scanning
40+
uses: github/codeql-action/upload-sarif@v2
41+
with:
42+
sarif_file: snyk.sarif

0 commit comments

Comments
 (0)