-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (49 loc) · 1.73 KB
/
scan_snyk-jira-integration.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Snyk Scan and Report
on:
pull_request:
branches: [main]
schedule:
- cron: "0 6 * * *" # daily at 0600 UTC
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'
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": "16955", "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"