-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (49 loc) · 1.57 KB
/
security.yml
File metadata and controls
60 lines (49 loc) · 1.57 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
name: Security
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: "0 0 * * 1"
workflow_dispatch:
jobs:
security-audit:
name: Security Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up DiffBio
uses: ./.github/actions/setup-diffbio
with:
python-version: "3.11"
cache-suffix: security
linux-editable-target: ".[dev]"
- name: Run security scans
shell: bash
run: |
set -euo pipefail
pip_audit_status=0
bandit_status=0
uv run --with pip-audit pip-audit --local --desc \
> pip-audit-report.txt || pip_audit_status=$?
uv run --with bandit bandit -c pyproject.toml -r src/diffbio/ -f json -o bandit-report.json \
|| bandit_status=$?
{
echo "## Security audit"
echo
echo "This workflow participates in automatic pull-request and push enforcement."
echo "pip-audit scans the resolved dependency tree against the PyPI advisory database;"
echo "bandit scans the DiffBio source tree for common Python security issues."
} >> "$GITHUB_STEP_SUMMARY"
if [[ "$pip_audit_status" -ne 0 || "$bandit_status" -ne 0 ]]; then
exit 1
fi
- name: Upload security report
uses: actions/upload-artifact@v4
if: always()
with:
name: security-report
path: |
pip-audit-report.txt
bandit-report.json