-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
netr0m
committed
Jun 17, 2024
1 parent
7060302
commit baa966d
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: On Schedule | ||
on: | ||
schedule: | ||
- cron: '30 2 * * 0' | ||
|
||
jobs: | ||
snyk: | ||
name: Scan dependencies | ||
uses: ./.github/workflows/snyk.yaml | ||
with: | ||
severity-treshold: medium | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Snyk Security | ||
on: | ||
workflow_call: | ||
inputs: | ||
severity-treshold: | ||
default: low | ||
description: Only report vulnerabilities of provided level or higher | ||
type: string | ||
fail-on-error: | ||
default: true | ||
description: Whether to fail if Snyk found errors | ||
type: boolean | ||
secrets: | ||
SNYK_TOKEN: | ||
required: true | ||
|
||
permissions: | ||
contents: read | ||
security-events: write | ||
|
||
jobs: | ||
snyk: | ||
name: Run Snyk | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
permissions: | ||
contents: read | ||
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Scan dependencies | ||
uses: snyk/actions/golang@master | ||
id: snyk-scan | ||
continue-on-error: true # To make sure that SARIF upload gets called | ||
env: | ||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | ||
with: | ||
command: test --sarif-file-output=snyk-test.sarif --severity-threshold=${{ inputs.severity-treshold }} --fail-on=all | ||
|
||
- name: Upload result to GitHub Code Scanning | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: snyk-test.sarif | ||
|
||
- name: Fail on Snyk test error | ||
if: steps.snyk-scan.outcome != 'success' && inputs.fail-on-error | ||
run: exit 1 |