Update dependencies and pre-commit hooks #12
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 and pre-commit hooks | |
| on: | |
| schedule: | |
| - cron: "0 2 * * 1,3,5" # Every mon, wen, fri at 2am utc | |
| workflow_dispatch: | |
| inputs: | |
| automerge: | |
| description: "enable automerge" | |
| required: false | |
| type: boolean | |
| default: false | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| env: | |
| AUTOMERGE: "true" | |
| jobs: | |
| update: | |
| name: Bump versions | |
| runs-on: ubuntu-latest | |
| environment: pull-request | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: ./.github/actions/setup-cached-uv-and-python | |
| with: | |
| python-version-file: ".python-version" | |
| cache-dependency-path: requirements/lock/uvx-tools.txt | |
| - uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0 | |
| - name: Update requirements | |
| run: just lock --upgrade | |
| - name: Update pre-commit hooks | |
| run: just lint-upgrade | |
| - name: Git config | |
| run: | | |
| git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git config --global user.name "github-actions[bot]" | |
| - name: Create pull request | |
| id: cpr | |
| uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 | |
| with: | |
| token: ${{ secrets.PAT }} | |
| add-paths: . | |
| commit-message: | |
| "chore(deps): update dependencies and pre-commit hooks" | |
| title: "chore(deps): update dependencies and pre-commit hooks" | |
| labels: dependencies | |
| branch: deps/update | |
| delete-branch: true | |
| body: | | |
| This is an autogenerated PR. Use this to merge changes to this repository. | |
| - name: Pull request info | |
| if: ${{ steps.cpr.outputs.pull-request-number }} | |
| env: | |
| NUMBER: ${{ steps.cpr.outputs.pull-request-number }} | |
| URL: ${{ steps.cpr.outputs.pull-request-url }} | |
| OPERATION: ${{ steps.cpr.outputs.pull-request-operation }} | |
| SHA: ${{ steps.cpr.outputs.pull-request-sha }} | |
| BRANCH: ${{ steps.cpr.outputs.pull-request-branch }} | |
| VERIFIED: ${{ steps.cpr.outputs.pull-request-commits-verified }} | |
| run: | | |
| echo "Pull Request Number - $NUMBER" | |
| echo "Pull Request URL - $URL" | |
| echo "Pull Request Operation - $OPERATION" | |
| echo "Pull Request SHA - $SHA" | |
| echo "Pull Request BRANCH - $BRANCH" | |
| echo "Pull Request VERIFIED - $VERIFIED" | |
| - name: automerge | |
| if: | |
| ${{ (inputs.automerge || env.AUTOMERGE == 'true') && | |
| steps.cpr.outputs.pull-request-number }} | |
| env: | |
| NUMBER: ${{ steps.cpr.outputs.pull-request-number }} | |
| # Need PAT if want to start other actions. Use GITHUB_TOKEN if not. | |
| GH_TOKEN: ${{ secrets.PAT }} | |
| run: | | |
| gh pr merge -m --auto "$NUMBER" |