name: Dependency Updates on: schedule: # Run every Monday at 9:00 AM UTC - cron: '0 9 * * 1' workflow_dispatch: permissions: contents: write pull-requests: write concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: PYTHONUNBUFFERED: 1 jobs: update-dependencies: name: Update Dependencies runs-on: ubuntu-latest timeout-minutes: 20 steps: - name: Checkout repository uses: actions/checkout@v7 with: # Use a Personal Access Token (PAT) named DEPENDENCY_UPDATE_TOKEN if # you want the created PR to trigger CI workflows (on: pull_request). # The default GITHUB_TOKEN suppresses further workflow runs on the PR. token: ${{ secrets.DEPENDENCY_UPDATE_TOKEN || secrets.GITHUB_TOKEN }} - name: Set up Python uses: actions/setup-python@v7.0.0 with: python-version: "3.14" cache: 'pip' - name: Install system dependencies run: | sudo apt-get update sudo apt-get install -y build-essential libssl-dev libicapapi-dev python3-dev libpq-dev - name: Install pip-tools run: | python -m pip install --upgrade "pip==25.3" "pip-tools==7.5.3" python -m pip --version - name: Compile updated requirements id: compile run: | python -m piptools compile \ --upgrade \ --output-file requirements.txt \ requirements.in if git diff --quiet requirements.txt; then echo "dependencies_updated=false" >> "$GITHUB_OUTPUT" else echo "dependencies_updated=true" >> "$GITHUB_OUTPUT" { echo "diff<> "$GITHUB_OUTPUT" fi - name: Install updated dependencies if: steps.compile.outputs.dependencies_updated == 'true' run: pip install -r requirements.txt - name: Run smoke tests if: steps.compile.outputs.dependencies_updated == 'true' run: | python - << 'EOF' import sys import os sys.path.insert(0, os.getcwd()) try: from app import create_app from database.database import get_engine, create_dynamic_tables print("✅ Core imports OK") except Exception as e: print(f"❌ Import error: {e}") sys.exit(1) EOF - name: Run linting if: steps.compile.outputs.dependencies_updated == 'true' run: | pip install ruff ruff check . || echo "⚠️ Linting issues found" - name: Create Pull Request if: steps.compile.outputs.dependencies_updated == 'true' id: cpr uses: peter-evans/create-pull-request@v8 with: token: ${{ secrets.DEPENDENCY_UPDATE_TOKEN || secrets.GITHUB_TOKEN }} commit-message: | chore: update dependencies Update pinned dependencies to their latest compatible versions. committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> signoff: false branch: dependency-updates delete-branch: true add-paths: | requirements.in requirements.txt title: "chore: Update dependencies" body: | ## Dependency Updates This PR updates the pinned dependencies to their latest compatible versions. ### Changes - Regenerated `requirements.txt` from `requirements.in` with `pip-compile --upgrade` - Core import smoke tests passed - Linting checked ### Diff ```diff ${{ steps.compile.outputs.diff }} ``` ### Testing - [ ] Manual testing of key features - [ ] Performance impact evaluation - [ ] Security review of new versions --- *This PR was created automatically by the dependency update workflow.* labels: | dependencies automated