Security #287
This file contains hidden or 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 | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| schedule: | |
| # Run security scans weekly | |
| - cron: '0 0 * * 0' | |
| jobs: | |
| # dependency-review: | |
| # name: Dependency Review | |
| # runs-on: ubuntu-latest | |
| # if: github.event_name == 'pull_request' | |
| # steps: | |
| # - name: Checkout code | |
| # uses: actions/checkout@v4 | |
| # - name: Dependency Review | |
| # uses: actions/dependency-review-action@v4 | |
| security-scan: | |
| name: Security Scan | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel | |
| pip install safety bandit | |
| - name: Run safety check | |
| run: | | |
| safety check --json --output safety-report.json || echo "⚠️ Safety check found issues" | |
| safety check || echo "⚠️ Safety check completed with warnings" | |
| - name: Run bandit security linter | |
| run: | | |
| bandit -r cli/ api/ -f json -o bandit-report.json || true | |
| bandit -r cli/ api/ -ll || echo "⚠️ Bandit found potential security issues" | |
| - name: Upload security reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: security-reports | |
| path: | | |
| safety-report.json | |
| bandit-report.json | |
| retention-days: 30 |