Vulnerability checks #25
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: Vulnerability checks | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
types: [opened, reopened, synchronize] | |
branches: | |
- 'main' | |
- 'release/v*' | |
paths: | |
- 'src/**' | |
schedule: | |
- cron: '0 4 * * 1' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python "3.11" | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install bandit | |
- name: Run bandit | |
run: | | |
# Run bandit | |
bandit -r src -c pyproject.toml -o bandit_outputs.txt -f txt --skip B311 | |
- name: Archive bandit outputs | |
uses: actions/upload-artifact@v3 | |
with: | |
name: bandit_outputs | |
path: bandit_outputs.txt | |
retention-days: 2 | |
- name: Run safety | |
run: | | |
pip install -r requirements.txt | |
pip install safety | |
safety check --output text --continue-on-error > insecure_report.txt | |
- name: Archive safety outputs | |
uses: actions/upload-artifact@v3 | |
with: | |
name: safety_outputs | |
path: | | |
insecure_report.txt | |
retention-days: 2 |