Skip to content

Commit 56ea22f

Browse files
committed
fix: fix lint
1 parent bd8fc5f commit 56ea22f

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

.github/workflows/security.yml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,38 @@ on:
99
jobs:
1010
security:
1111
runs-on: ubuntu-latest
12+
1213
steps:
1314
- uses: actions/checkout@v4
1415

15-
- name: Run Bandit security scan
16+
# Use the same Python that your project targets
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.10'
21+
22+
- name: Install Poetry
23+
run: |
24+
pipx install poetry
25+
poetry --version
26+
27+
# Install project deps in Poetry venv (dev group included so scanners are available)
28+
- name: Install dependencies with Poetry
1629
run: |
17-
pip install bandit
18-
bandit -r min_ratio_cycle/
30+
poetry install --with dev --no-interaction --no-ansi
1931
20-
- name: Run Safety check
32+
# --- Bandit: run in the project venv, tune failure level if desired ---
33+
- name: Bandit (security linter)
2134
run: |
22-
pip install safety
23-
safety check
35+
poetry run bandit -r min_ratio_cycle/ --severity-level medium --confidence-level high
2436
25-
- name: Dependency vulnerability scan
26-
uses: pypa/[email protected]
37+
# OPTION A: Safety scans the *installed* packages inside your Poetry venv
38+
- name: Safety (scan installed env)
39+
run: |
40+
poetry run pip install --upgrade safety
41+
poetry run safety check --full-report
42+
43+
- name: pip-audit (scan exported requirements, not global env)
44+
run: |
45+
pipx install pip-audit
46+
pip-audit -r requirements.txt --strict

0 commit comments

Comments
 (0)