Update pre-commit hooks #263
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 pre-commit hooks | |
| on: | |
| schedule: | |
| - cron: '37 21 * * 4' | |
| workflow_dispatch: | |
| env: | |
| FORCE_COLOR: 1 | |
| jobs: | |
| auto-update: | |
| name: Update pre-commit hooks | |
| if: ${{ github.repository == 'KlubJagiellonski/pola-backend' }} | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: "Setup Python" | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version-file: '.python-version' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install -U pip wheel setuptools virtualenv | |
| python -m pip install pre-commit | |
| - name: Use pre-commit environment cache | |
| uses: actions/cache@v6 | |
| with: | |
| key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | |
| path: ~/.cache/pre-commit | |
| restore-keys: ${{ runner.os }}-pre-commit- | |
| - name: Run pre-commit automatic update | |
| run: | | |
| pre-commit autoupdate | |
| pre-commit run --all-files | |
| - uses: peter-evans/create-pull-request@v8.1.1 | |
| with: | |
| base: master | |
| body: Update pre-commit hooks to their latest versions. | |
| branch: update-pre-commit-hooks | |
| commit-message: 'Update pre-commit hooks' | |
| committer: github-actions[bot] <github-actions[bot]@users.noreply.github.com> | |
| delete-branch: true | |
| title: Update pre-commit hooks | |
| token: ${{ github.token }} |