fix: use pip-audit exit code for vulnerability check
All checks were successful
PR Checks / 📏 Lint & Type Check (pull_request) Successful in 31s
PR Checks / 🧪 Tests (pull_request) Successful in 38s
PR Checks / 🔒 Security (pull_request) Successful in 1m45s

This commit is contained in:
root 2026-03-29 20:50:40 +00:00
parent bc82574fb0
commit 7def4e3abb

View File

@ -112,12 +112,14 @@ jobs:
UV_NO_PROGRESS: "1"
run: |
uv pip compile pyproject.toml --no-deps -o requirements-prod.txt
uv run pip-audit --format json --output audit-results.json -r requirements-prod.txt || true
if [ -s audit-results.json ] && [ "$(cat audit-results.json)" != "[]" ]; then
echo "❌ Found vulnerabilities"
# pip-audit returns exit code 1 if vulnerabilities found, 0 if none
if uv run pip-audit --format json --output audit-results.json -r requirements-prod.txt; then
echo "✅ No vulnerabilities found"
rm -f audit-results.json
else
echo "❌ Found vulnerabilities - see security-audit artifact"
exit 1
fi
echo "✅ No vulnerabilities found"
- name: Upload audit log
uses: actions/upload-artifact@v3