From 5661f352130c8848362f5889a5cf123bd5680c3d Mon Sep 17 00:00:00 2001 From: Eugene R Date: Tue, 3 Oct 2023 16:02:23 +0300 Subject: [PATCH] Add Snyk scan workflow (#3) add Snyk scan workflow --- .github/workflows/snyk-scan.yml | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/snyk-scan.yml diff --git a/.github/workflows/snyk-scan.yml b/.github/workflows/snyk-scan.yml new file mode 100644 index 00000000..d6e26f84 --- /dev/null +++ b/.github/workflows/snyk-scan.yml @@ -0,0 +1,37 @@ +name: Snyk scan +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + snyk-security: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Run Snyk to check for vulnerabilities + uses: snyk/actions/golang@master + continue-on-error: true # To make sure that SARIF upload gets called + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} + with: + args: --all-projects --sarif-file-output=snyk.sarif + + - name: Check output file + id: out-file + run: | + if test -f "snyk.sarif"; then + echo "::set-output name=exists::true"; else + echo "::set-output name=exists::false" + fi + + - name: Upload result to GitHub Code Scanning + if: steps.out-file.outputs.exists == 'true' + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: snyk.sarif \ No newline at end of file