Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated action and added assignee #139433

Merged
merged 2 commits into from
Aug 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 28 additions & 30 deletions .github/workflows/snyk-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Snyk Scan and Report

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

permissions:
id-token: write
Expand All @@ -14,46 +14,44 @@ jobs:
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:
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": "16958", "value": "CARTS"}] }'
jira-labels: 'CARTS,snyk'
jira-title-prefix: '[CARTS] - Snyk :'
scan-output-path: 'snyk_output.txt'
scan-type: 'snyk'

- 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: "620e936fa715c6006914c7d2" # pragma: allowlist secret (Jira user ID for Rehman)
scan-output-path: "snyk_output.txt"
scan-type: "snyk"
Loading