Skip to content

Commit 74d8b57

Browse files
Merge pull request #456 from GSA/issue-on-snyk-failure
create issue on snyk failure
2 parents 9a5dc0a + 9f19da4 commit 74d8b57

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

.github/snyk_failure.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Snyk Check Failed
3+
labels: ["bug", "o&m", "compliance"]
4+
---
5+
6+
Workflow with Issue: {{ workflow }}
7+
Job Failed: {{ env.GITHUB_JOB }}
8+
9+
Github Action Run: https://github.com/GSA/datagov-11ty/actions/runs/{{ env.RUN_ID }}

.github/workflows/snyk.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
branches: [ main ]
66
schedule:
7-
- cron: '0 5 * * *' # Run at midnight Eastern Time every day (midnight EST/1 AM EDT)
7+
- cron: '0 5 * * 1-5' # Run at midnight EST/1 AM EDT on weekdays (Mon-Fri)
88
workflow_dispatch: # Allow manual triggering
99

1010
jobs:
@@ -32,5 +32,16 @@ jobs:
3232
run: snyk auth ${{ secrets.SNYK_TOKEN }}
3333

3434
- name: Run Snyk test for vulnerabilities
35-
run: snyk test --severity-threshold=high
36-
continue-on-error: true
35+
run: snyk test --severity-threshold=medium
36+
37+
- name: Create Issue for failure 😢
38+
if: ${{ failure() }}
39+
uses: JasonEtco/create-an-issue@v2
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
GITHUB_JOB: ${{ toJson(github)['job'] }}
43+
GITHUB_ATTEMPTS: ${{ github.run_attempt }}
44+
RUN_ID: ${{ github.run_id }}
45+
with:
46+
filename: .github/snyk_failure.md
47+
update_existing: true

0 commit comments

Comments
 (0)