-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsbom-diff-and-risk-code-scanning.yml
More file actions
62 lines (52 loc) · 1.88 KB
/
sbom-diff-and-risk-code-scanning.yml
File metadata and controls
62 lines (52 loc) · 1.88 KB
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
name: sbom-diff-and-risk-code-scanning
run-name: sbom-diff-and-risk code scanning / ${{ github.event_name }} / ${{ github.ref_name }}
on:
workflow_dispatch:
pull_request:
paths:
- ".github/workflows/sbom-diff-and-risk-code-scanning.yml"
- "tools/sbom-diff-and-risk/**"
permissions: {}
env:
SBOM_DIFF_RISK_PYTHON_VERSION: "3.11"
SBOM_DIFF_RISK_SARIF_ARTIFACT_NAME: sbom-diff-and-risk-sarif
SBOM_DIFF_RISK_SARIF_CATEGORY: sbom-diff-risk/example
SBOM_DIFF_RISK_SARIF_FILE: outputs/report.sarif
jobs:
upload-sarif:
runs-on: ubuntu-latest
permissions:
security-events: write
contents: read
defaults:
run:
working-directory: tools/sbom-diff-and-risk
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.SBOM_DIFF_RISK_PYTHON_VERSION }}
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install sbom-diff-and-risk
run: python -m pip install -e .[dev]
- name: Generate SARIF report
run: |
mkdir -p outputs
python -m sbom_diff_risk.cli compare \
--before examples/sarif_before.json \
--after examples/sarif_after.json \
--out-sarif ${{ env.SBOM_DIFF_RISK_SARIF_FILE }}
- name: Upload SARIF workflow artifact
uses: actions/upload-artifact@v7
with:
name: ${{ env.SBOM_DIFF_RISK_SARIF_ARTIFACT_NAME }}
path: tools/sbom-diff-and-risk/${{ env.SBOM_DIFF_RISK_SARIF_FILE }}
if-no-files-found: error
- name: Upload SARIF to code scanning
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: tools/sbom-diff-and-risk/${{ env.SBOM_DIFF_RISK_SARIF_FILE }}
category: ${{ env.SBOM_DIFF_RISK_SARIF_CATEGORY }}