File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
python_project_deployment/templates Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 8282 run: |
8383 uv pip install twine
8484 twine check dist/*
85+
86+ security:
87+ name: Security Scan (Bandit + Safety)
88+ runs-on: ubuntu-latest
89+ needs: test
90+ permissions:
91+ contents: read
92+ security-events: write
93+
94+ steps:
95+ - uses: actions/checkout@v4
96+
97+ - name: Install uv
98+ run: |
99+ curl -LsSf https://astral.sh/uv/install.sh | sh
100+ echo "$HOME/.cargo/bin" >> $GITHUB_PATH
101+
102+ - name: Create virtual environment
103+ run: uv venv
104+
105+ - name: Install security tools
106+ run: |
107+ source .venv/bin/activate
108+ uv pip install bandit safety
109+
110+ - name: Run Bandit (security linter)
111+ run: |
112+ source .venv/bin/activate
113+ bandit -r {{ PKG }} -f json -o bandit-report.json || true
114+ bandit -r {{ PKG }} -f txt
115+
116+ - name: Run Safety (dependency vulnerability scanner)
117+ run: |
118+ source .venv/bin/activate
119+ safety check --json > safety-report.json || true
120+ safety check
121+
122+ - name: Upload security reports
123+ if: always()
124+ uses: actions/upload-artifact@v4
125+ with:
126+ name: security-reports
127+ path: |
128+ bandit-report.json
129+ safety-report.json
You can’t perform that action at this time.
0 commit comments