From f832404f98b5d42298fc26e81c8b2d2eb75cd09a Mon Sep 17 00:00:00 2001 From: hoseacodes Date: Fri, 11 Aug 2023 06:57:38 -0500 Subject: [PATCH] fix(githubActions): add dependency scan static scan --- .github/workflows/main.yaml | 48 +++++++++++++++++++++++++++++++++++ .github/workflows/master.yaml | 19 +++++--------- 2 files changed, 54 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/main.yaml diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 00000000..145f05a7 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,48 @@ +name: Snyk Scan +on: + push: + branches: + - main +jobs: + static-scan: + runs-on: ubuntu-latest + env: + JSON_OUTPUT: snyk-static-scan.json + steps: + - uses: actions/checkout@master + - uses: snyk/actions/setup@master + - uses: actions/setup-go@v1 + - name: Run Snyk to check for vulnerabilities + continue-on-error: true + run: | + snyk code test + snyk-to-html -i $JSON_OUTPUT -o snyk.html + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} + - name: Archive snyk results + uses: actions/upload-artifact@v3 + with: + name: snyk-report + path: output/scan/snyk.html + retention-days: 5 + dependency-scan: + runs-on: ubuntu-latest + env: + JSON_OUTPUT: snyk-dependency-scan.json + steps: + - uses: actions/checkout@master + - uses: snyk/actions/setup@master + - uses: actions/setup-go@v1 + - name: Run Snyk to check for vulnerabilities + continue-on-error: true + run: | + snyk test + snyk-to-html -i $JSON_OUTPUT -o snyk.html + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} + - name: Archive snyk results + uses: actions/upload-artifact@v3 + with: + name: snyk-report + path: output/scan/snyk.html + retention-days: 5 \ No newline at end of file diff --git a/.github/workflows/master.yaml b/.github/workflows/master.yaml index a63f18aa..b7e4c5ca 100644 --- a/.github/workflows/master.yaml +++ b/.github/workflows/master.yaml @@ -1,24 +1,17 @@ name: Snyk Scan -on: push +on: + push: + branches: + - master jobs: security: runs-on: ubuntu-latest - env: - JSON_OUTPUT: snyk-static-scan.json steps: - uses: actions/checkout@master - - uses: snyk/actions/setup@master - - uses: actions/setup-go@v1 - name: Run Snyk to check for vulnerabilities + uses: snyk/actions/node@master continue-on-error: true - run: | - snyk code test - snyk-to-html -i $JSON_OUTPUT -o snyk.html env: SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} - - name: Archive snyk results - uses: actions/upload-artifact@v3 with: - name: snyk-report - path: output/scan/snyk.html - retention-days: 5 \ No newline at end of file + command: monitor \ No newline at end of file