forked from misiektoja/spotify_profile_monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (75 loc) · 2.85 KB
/
Copy pathsupply-chain.yml
File metadata and controls
88 lines (75 loc) · 2.85 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Supply chain
on:
push:
pull_request:
workflow_dispatch:
schedule:
# A weekly run catches vulnerabilities that are published after a change merged.
- cron: "17 5 * * 1"
permissions: {}
jobs:
gitleaks:
name: Leaked credentials
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
# The history scan needs every commit, not just the checked out tip.
fetch-depth: 0
- name: Run gitleaks scan
uses: gitleaks/gitleaks-action@e0c47f4f8be36e29cdc102c57e68cb5cbf0e8d1e # v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLEAKS_CONFIG: .gitleaks.toml
GITLEAKS_ENABLE_COMMENTS: "false"
pip-audit:
name: Vulnerable dependencies
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: "3.13"
- name: Install pip-audit
run: python -m pip install --upgrade pip pip-audit
- name: Audit the resolved dependency tree
# Auditing the project rather than the runner environment keeps pip-audit's own dependencies
# out of the result, so a finding always concerns something a user actually installs.
run: pip-audit --strict --progress-spinner=off .
sbom:
name: Software bill of materials
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: "3.13"
- name: Install the project into an isolated environment
# The SBOM records the transitive closure a user really gets, which needs a resolved install
# rather than the version floors declared in pyproject.toml.
run: |
python -m venv local/sbom-venv
local/sbom-venv/bin/python -m pip install --upgrade pip
local/sbom-venv/bin/python -m pip install .
- name: Generate the SBOM
run: |
python -m pip install cyclonedx-bom
mkdir -p dist
cyclonedx-py environment local/sbom-venv/bin/python --of JSON -o dist/spotify_profile_monitor.cdx.json
- name: Publish the SBOM
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: spotify-profile-monitor-sbom
path: dist/spotify_profile_monitor.cdx.json
if-no-files-found: error