Skip to content

Commit 192f71c

Browse files
authored
Cache things with entropy-beauty-scan.yml (#8064)
* Cache things with entropy-beauty-scan.yml * entropy-beauty-scan.yml using standard parts, no need for reqs * entropy-beauty-scan.yml don't cache pip
1 parent 6132656 commit 192f71c

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

.github/workflows/entropy-beauty-scan.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,27 @@ jobs:
1414
- name: Checkout code (full history)
1515
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1616
with:
17-
fetch-depth: 0
17+
# Use shallow clone by default (much faster)
18+
# Only use full history when necessary (push/release or when base commit is needed)
19+
fetch-depth: ${{ github.event_name == 'pull_request_target' && 2 || 0 }}
20+
21+
- name: Cache pip manually
22+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
23+
with:
24+
path: ~/.cache/pip
25+
key: ${{ runner.os }}-pip-entropy-${{ hashFiles('.github/workflows/compute-entropy.py') }}
26+
restore-keys: |
27+
${{ runner.os }}-pip-entropy-
28+
29+
- name: Setup Python
30+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
31+
with:
32+
python-version: '3.12'
33+
34+
- name: Install Python dependencies (only when needed)
35+
run: |
36+
python -m pip install --upgrade pip
37+
# No extra packages needed — compute-entropy.py uses only stdlib
1838
1939
- name: Run TruffleHog
2040
uses: trufflesecurity/trufflehog@586f66d7886cd0b037c7c245d4a6e34ef357ab10 # main (as of March 2026)

0 commit comments

Comments
 (0)