Security Checks #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Security Checks | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Run daily | |
workflow_dispatch: | |
jobs: | |
security: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install safety bandit | |
- name: Run dependency check | |
run: safety check | |
- name: Run security scan | |
run: bandit -r src/ -f json -o security-report.json | |
- name: Upload security report | |
uses: actions/upload-artifact@v3 | |
with: | |
name: security-report | |
path: security-report.json | |
- name: Check for vulnerabilities | |
run: | | |
if [ -s security-report.json ]; then | |
echo "Security vulnerabilities found" | |
exit 1 | |
fi |