Skip to content

Commit 770bd7d

Browse files
feat: add slack notification for snyk failure (#411)
1 parent 895fea2 commit 770bd7d

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/snyk.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,27 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818
- name: Run Snyk to check for vulnerabilities
19+
id: snyk
1920
uses: snyk/actions/python-3.10@master
2021
continue-on-error: true # To make sure that SARIF upload gets called
2122
env:
2223
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
2324
with:
2425
args: --severity-threshold=high --sarif-file-output=snyk.sarif
26+
2527
- name: Upload result to GitHub Code Scanning
2628
uses: github/codeql-action/upload-sarif@v3
2729
with:
2830
sarif_file: snyk.sarif
31+
32+
- name: Notify Slack on Failure
33+
if: steps.snyk.outcome == 'failure'
34+
run: |
35+
curl -X POST -H 'Content-type: application/json' \
36+
--data "{
37+
\"repository\": \"${{ github.repository }}\",
38+
\"branch\": \"${{ github.ref_name }}\",
39+
\"actor\": \"${{ github.actor }}\",
40+
\"run_url\": \"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\"
41+
}" \
42+
${{ secrets.SLACK_WEBHOOK_URL }}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### **Added**
1111

12+
- added slack notification on failure in the snyk workflow
1213
- added UPDATE handler support for `sagemaker-templates` GitHub repository custom resource:
1314
- CodeConnectionArn changes: updates CodeBuild source credentials
1415
- S3BucketObjectKey changes (seed code updates): creates branch and pull request with new code

0 commit comments

Comments
 (0)