-
-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (40 loc) · 1.2 KB
/
Copy pathupdate-requirements.yml
File metadata and controls
48 lines (40 loc) · 1.2 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
name: Security Scan
on:
push:
branches: [main]
pull_request:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install pip-audit
run: pip install pip-audit
- name: Run pip-audit
id: pip-audit
continue-on-error: true
run: |
echo "## pip-audit Security Scan" >> $GITHUB_STEP_SUMMARY
pip-audit --desc --format markdown >> $GITHUB_STEP_SUMMARY || true
pip-audit --require pyproject.toml
- name: Try Safety fallback
if: steps.pip-audit.outcome == 'failure'
continue-on-error: true
env:
SAFETY_API_KEY: ${{ secrets.SAFETY_API_KEY }}
run: |
if [ -n "$SAFETY_API_KEY" ]; then
pip install safety
echo "## Safety Scan" >> $GITHUB_STEP_SUMMARY
safety check --output json || echo "Safety API down"
fi
- name: Summary
if: always()
run: echo "✅ Security scan completed"