Update pre-commit version #241
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 version | |
| on: | |
| schedule: | |
| - cron: '0 18 * * *' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Upgrade pre-commit | |
| run: | | |
| pip install --upgrade pre-commit | |
| pre-commit --version | |
| pre-commit autoupdate | |
| - name: Commit and push changes | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| if [[ $(git status --porcelain) ]]; then | |
| git add . | |
| git commit -m "Update pre-commit hooks" | |
| git push | |
| else | |
| echo "No changes to commit" | |
| fi | |
| ... |