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 jobs: update-dependencies: name: Update Dependencies runs-on: ubuntu-latest timeout-minutes: 15 steps: - name: Checkout repository uses: actions/checkout@v6 with: token: ${{ secrets.GITHUB_TOKEN }} - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.11" cache: 'pip' - name: Install pip-tools run: | python -m pip install --upgrade pip pip install pip-tools - 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: Update dependencies run: | # Backup current requirements cp requirements.txt requirements.txt.bak # Update requirements (simple upgrade) pip install --upgrade -r requirements.txt # Check if there are changes if ! diff -q requirements.txt requirements.txt.bak > /dev/null; then echo "dependencies_updated=true" >> $GITHUB_ENV else echo "dependencies_updated=false" >> $GITHUB_ENV fi - name: Test updated dependencies if: env.dependencies_updated == 'true' run: | # Install updated dependencies pip install -r requirements.txt # Run basic tests to ensure nothing is broken python -c " import sys import os sys.path.insert(0, os.getcwd()) try: from app import app from database.database import get_engine, create_dynamic_tables except Exception as e: print(f'❌ Import error: {e}') sys.exit(1) " # Run linting pip install ruff ruff check . || echo "⚠️ Linting issues found" - name: Create Pull Request if: env.dependencies_updated == 'true' uses: peter-evans/create-pull-request@v5 with: token: ${{ secrets.GITHUB_TOKEN }} commit-message: "chore: update dependencies" title: "chore: Update dependencies" body: | ## Dependency Updates This PR updates the project dependencies to their latest versions. ### Changes - Updated all dependencies in `requirements.txt` - Basic import tests passed - Linting checked ### Testing - [ ] Manual testing of key features - [ ] Performance impact evaluation - [ ] Security review of new versions ### Notes Please review the changes and test thoroughly before merging. --- *This PR was created automatically by the dependency update workflow.* branch: dependency-updates delete-branch: true labels: dependencies,automated