Update dependencies #21
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: Update dependencies | |
| on: | |
| schedule: | |
| # Run weekly on Mondays at 9 AM UTC | |
| - cron: '0 9 * * 1' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| update-deps: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: dev | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Update dependencies | |
| env: | |
| GH_TOKEN: ${{ secrets.QUANTEM_BOT_PAT }} | |
| REPO: ${{ github.repository }} | |
| run: | | |
| set -e | |
| git config user.name "quantem-bot" | |
| git config user.email "quantembot@gmail.com" | |
| # Update the lock file | |
| uv lock --upgrade | |
| # Check if there are changes | |
| if git diff --quiet uv.lock; then | |
| echo "No dependency updates available" | |
| exit 0 | |
| fi | |
| # Create branch and commit | |
| BRANCH="chore/update-lockfile-$(date +%Y%m%d)" | |
| git checkout -b "$BRANCH" | |
| git add uv.lock | |
| git commit -m "chore: update lock file" | |
| git push origin "$BRANCH" | |
| # Create PR | |
| PR_BODY=$(printf "Automated dependency update via \`uv lock --upgrade\`.\n\nPlease review the changes and run tests before merging.") | |
| gh pr create \ | |
| --repo "$REPO" \ | |
| --head "$BRANCH" \ | |
| --base dev \ | |
| --title "chore: Update dependencies" \ | |
| --body "$PR_BODY" |