-
-
Notifications
You must be signed in to change notification settings - Fork 100
76 lines (63 loc) · 2.13 KB
/
snapshot_tests.yml
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Generate Depscan Snapshots
on:
workflow_dispatch:
pull_request:
branches:
- master
push:
branches:
- master
concurrency:
group: "${{ github.workflow }}-${{ github.head_ref || github.run_id }}"
cancel-in-progress: true
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install depscan
run: |
python -m pip install --upgrade pip
python -m venv .venv
source .venv/bin/activate
pip install .
- name: Cache vdb
id: cache-vdb
uses: actions/cache@v4
with:
path: /home/runner/.local/share/vdb
key: vdb-snapshot-cache
- name: Get boms
run: |
git clone https://github.com/appthreat/cdxgen-samples.git /home/runner/work/new_snapshots
cd /home/runner/work/new_snapshots
git checkout b5dc7d02548bc8f8983d981dc21de5612e37731c
- name: Get original snapshots
run: |
git clone https://github.com/AppThreat/dep-scan-snapshots.git /home/runner/work/original_snapshots
- name: Generate snapshots and test
env:
DEPSCAN_CSAF_TEMPLATE: "/home/runner/work/dep-scan/dep-scan/contrib/csaf.toml"
INPUT_THANK_YOU: "I have sponsored OWASP-dep-scan."
run: |
source .venv/bin/activate
chmod +x /home/runner/work/dep-scan/dep-scan/test/snapshots.py
/home/runner/work/dep-scan/dep-scan/test/snapshots.py
if test -f /home/runner/work/new_snapshots/diffs.json; then
echo "status=FAILED" >> "$GITHUB_ENV"
fi
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
path: |
/home/runner/work/new_snapshots/*.vdr.json
/home/runner/work/new_snapshots/*.csaf_v1.json
/home/runner/work/new_snapshots/diffs.json
/home/runner/work/new_snapshots/*.html
- name: Exit with error
if: ${{ env.status == 'FAILED' }}
run: exit 1