Merge pull request #63 from saichandrapandraju/interval-parser #111
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 Scan | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| bandit-scan: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| security-events: write | |
| actions: read | |
| contents: read | |
| checks: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| - name: Create virtual environment | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install uv | |
| python -m venv .venv | |
| - name: Install dependencies | |
| run: | | |
| source .venv/bin/activate | |
| if [ -f pyproject.toml ]; then | |
| uv pip install -e ".[dev]" | |
| fi | |
| - name: Install Bandit | |
| run: | | |
| source .venv/bin/activate | |
| python -m pip install bandit[toml] | |
| - name: Run Bandit Security Scan | |
| uses: PyCQA/bandit-action@v1 | |
| with: | |
| targets: "src/" | |
| - name: Upload SARIF results to GitHub Security tab | |
| if: github.ref == 'refs/heads/main' | |
| uses: github/codeql-action/upload-sarif@v3 | |
| with: | |
| sarif_file: results.sarif | |
| category: bandit-security-scan | |
| continue-on-error: true | |
| - name: Upload SARIF as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bandit-sarif-results | |
| path: results.sarif | |
| retention-days: 30 | |
| continue-on-error: true |