-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (40 loc) · 1.23 KB
/
ensure-snyk-policy-version.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
name: Ensure Snyk File Versions
on:
workflow_dispatch:
# pull_request:
# branches: [main]
# push:
# branches: [main]
jobs:
Check-Versions:
name: Ensure Snyk Policy Version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Ensure correct .snyk version
run: |
echo "${{ secrets.SNYK_SHA }}" | sha256sum --check --status -
if [ $? -eq 0 ]; then
echo ".snyk file is up-to-date."
else
echo ".snyk file was missing or outdated."
fi
- name: Ensure correct snyk-test.yaml version
run: |
echo "${{ secrets.SNYK_TEST_SHA }}" | sha256sum --check --status -
if [ $? -eq 0 ]; then
echo ".github/workflows/snyk-test.yaml is up-to-date."
else
echo ".github/workflows/snyk-test.yaml file was missing or outdated."
fi
Trigger-Test:
needs: Check-Versions
name: Trigger Snyk test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- env:
GH_TOKEN: ${{ secrets.MY_TOKEN }}
SNYK_ACTION_NAME: ${{ secrets.SNYK_ACTION_NAME }}
run: |
gh workflow run $SNYK_ACTION_NAME