Skip to content

Add high priority alert banner for IRGC Iran threat #134

Add high priority alert banner for IRGC Iran threat

Add high priority alert banner for IRGC Iran threat #134

Workflow file for this run

name: Security & Quality Checks
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
security:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# ==================== Professional Code Quality (Flake8) ====================
# This replaces the basic py_compile check.
- name: Python Syntax & Logic Linting
run: |
# Stop the build if there are Python syntax errors or undefined names
# E9, F63, F7, and F82 are the "Critical" errors that break apps.
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
echo "✅ Python logic and syntax validation passed"
# ==================== CodeQL (SAST + Dependency Scanning) ====================
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: python
queries: security-extended
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
# ==================== Secret Detection ====================
- name: Scan for Secrets
uses: trufflesecurity/trufflehog@main
with:
base: ${{ github.event.repository.default_branch }}
head: HEAD
extra_args: --only-verified
continue-on-error: true
# ==================== Final Runtime Readiness ====================
- name: Final Script Compilation Check
run: |
python -m py_compile streamlit_app.py
echo "✅ streamlit_app.py is ready for deployment"