Pre-commit auto-update #75
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: Pre-commit auto-update | |
| on: | |
| schedule: | |
| - cron: "0 1 * * 1" # runs at 01:00 UTC on Mondays | |
| # on demand | |
| workflow_dispatch: | |
| jobs: | |
| auto-update: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout full history | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| - name: Display Python version | |
| run: python -c "import sys; print(sys.version)" | |
| - name: Create temp .venv | |
| run: | | |
| python -m venv .venv | |
| source .venv/bin/activate | |
| - name: Install dependencies in dev mode | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| - name: Update pre-commit | |
| run: | | |
| pre-commit autoupdate | |
| - name: Create the PR pushing the changes | |
| uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e | |
| if: always() | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: update-pre-commit-hooks | |
| title: Update pre-commit hooks | |
| commit-message: "GHA: update pre-commit hooks" | |
| body: Update versions of pre-commit hooks to latest version. | |
| committer: github-actions[bot] <github-actions[bot]@users.noreply.github.com> | |
| author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com> | |
| reviewers: volpatto # add the maintainers to be set as reviewers here |