Skip to content

Commit

Permalink
upgraded snyk version
Browse files Browse the repository at this point in the history
  • Loading branch information
araya authored and araya committed Aug 24, 2023
1 parent 21846ca commit 2c96530
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/snyk-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Snyk Scan and Report

on:
pull_request:
branches: [main]
push:
branches: [snyk-upgrade]
schedule:
- cron: "0 4 * * *" # run every day at midnight

permissions:
id-token: write

jobs:
snyk_run:
name: Snyk Run (for PR and push)
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'

steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Install Snyk and Run Snyk test
run: |
npm install -g snyk
snyk test --all-projects --json > snyk_output.txt || true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

snyk_nightly_run:
name: Snyk Nightly Run (for nightly cron with JIRA)
runs-on: ubuntu-latest
if: github.event_name == 'schedule' || 'push'
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Install Snyk and Run Snyk test
run: |
npm install -g snyk
snyk test --all-projects --json > snyk_output.txt || true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

- name: use the custom github action to parse Snyk output
uses: Enterprise-CMCS/[email protected]
with:
jira-username: ${{ secrets.JIRA_SERVICE_USERNAME }}
jira-token: ${{ secrets.JIRA_SERVICE_USER_TOKEN }}
jira-host: "qmacbis.atlassian.net"
jira-project-key: "MDCT"
jira-issue-type: "Task"
jira-custom-field-key-value: '{ "customfield_10007" : "MDCT-2280", "customfield_14154" : [{"id": "16958", "value": "CARTS"}] }'
jira-labels: "CARTS,snyk"
jira-title-prefix: "[CARTS] - Snyk :"
assign-jira-ticket-to: ${{ secrets.ACCOUNT_ID_REHMAN }}
scan-output-path: "snyk_output.txt"
scan-type: "snyk"

0 comments on commit 2c96530

Please sign in to comment.