-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (49 loc) · 1.5 KB
/
security.yaml
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
---
name: Security Scans
on:
workflow_dispatch: {}
schedule:
- cron: "16 04 * * *"
jobs:
snyk:
name: Snyk Scan
runs-on: ubuntu-latest
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
permissions:
packages: read
contents: read
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v3
- uses: snyk/actions/setup@master
- run: pip install -r requirements.txt
working-directory: tests/docs
- run: |
snyk test --all-projects --severity-threshold=medium
snyk code test --all-projects --severity-threshold=medium
teams-notification:
if: ${{ failure() }}
name: Send an alram to Microsoft teams
needs: [snyk]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: aliencube/[email protected]
with:
webhook_uri: ${{ secrets.MS_TEAMS_WEBHOOK_URI }}
title: |
[SEC] Security scan failed for ${{ github.repository }}
text: |
*Scan status*
- Snyk: ${{needs.snyk.result }}
*Workflow run link:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
actions: |
[{
"@type": "OpenUri",
"name": "Workflow run",
"targets": [{
"os": "default",
"uri": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}]
}]