Tweaks #80
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Install uv | |
uses: astral-sh/setup-uv@v5 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install depscan | |
run: | | |
python -m pip install --upgrade pip | |
uv sync --all-extras --dev | |
- 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: | | |
chmod +x /home/runner/work/dep-scan/dep-scan/test/snapshots.py | |
uv run python /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 |