Dependency Update Check #19
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: Dependency Update Check | |
| on: | |
| schedule: | |
| # Run every Monday at 9:00 AM | |
| - cron: '0 9 * * 1' | |
| workflow_dispatch: # Manual trigger | |
| jobs: | |
| check-updates: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Check for outdated dependencies | |
| id: check | |
| run: | | |
| pip install pip-tools | |
| pip list --outdated --format=json > outdated.json | |
| echo "outdated=$(cat outdated.json)" >> $GITHUB_OUTPUT | |
| cat outdated.json | python3 -c "import json,sys; deps=json.load(sys.stdin); [print(f'{d[\"name\"]}=={d[\"version\"]} -> {d[\"latest_version\"]}') for d in deps[:20]]" || true | |
| - name: Install and test with latest deps | |
| run: | | |
| pip install -e ".[dev]" --upgrade | |
| pip install --upgrade costs pfix | |
| python -m pytest tests/ -v --tb=short -x | |
| - name: Create PR if tests pass | |
| if: success() && github.event_name == 'schedule' | |
| uses: peter-evans/create-pull-request@v6 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: deps/auto-update | |
| title: 'build(deps): automated dependency updates' | |
| body: | | |
| ## Automated Dependency Update | |
| This PR contains automated updates for: | |
| - Python packages | |
| Tests passed with latest versions. | |
| labels: dependencies, automated | |
| delete-branch: true |