Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions .github/snyk_failure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Snyk Check Failed
labels: ["bug", "o&m", "compliance"]
---

Workflow with Issue: {{ workflow }}
Job Failed: {{ env.GITHUB_JOB }}

Github Action Run: https://github.com/GSA/datagov-11ty/actions/runs/{{ env.RUN_ID }}
17 changes: 14 additions & 3 deletions .github/workflows/snyk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
branches: [ main ]
schedule:
- cron: '0 5 * * *' # Run at midnight Eastern Time every day (midnight EST/1 AM EDT)
- cron: '0 5 * * 1-5' # Run at midnight EST/1 AM EDT on weekdays (Mon-Fri)
workflow_dispatch: # Allow manual triggering

jobs:
Expand Down Expand Up @@ -32,5 +32,16 @@ jobs:
run: snyk auth ${{ secrets.SNYK_TOKEN }}

- name: Run Snyk test for vulnerabilities
run: snyk test --severity-threshold=high
continue-on-error: true
run: snyk test --severity-threshold=medium

- name: Create Issue for failure 😢
if: ${{ failure() }}
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_JOB: ${{ toJson(github)['job'] }}
GITHUB_ATTEMPTS: ${{ github.run_attempt }}
RUN_ID: ${{ github.run_id }}
with:
filename: .github/snyk_failure.md
update_existing: true