Pre-commit auto-update #76
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
| # from https://github.com/browniebroke/pre-commit-autoupdate-action | |
| name: Pre-commit auto-update | |
| on: | |
| # every day at midnight | |
| schedule: | |
| - cron: "0 16 * * 3" | |
| # on demand | |
| workflow_dispatch: | |
| permissions: {} | |
| jobs: | |
| auto-update: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v5 | |
| - uses: browniebroke/pre-commit-autoupdate-action@f5c3ec85103b9f8f9be60b9c006cec763d2bdd02 # v1.0.1 | |
| env: | |
| SKIP: "poetry-version-resetter" | |
| - name: Upload changed .pre-commit-config.yaml | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: ".pre-commit-config.yaml" | |
| path: ".pre-commit-config.yaml" | |
| # This second, dependent job is necessary to isolate the content:write permissions that the auto-update job doesn't need. | |
| pr: | |
| needs: auto-update | |
| permissions: | |
| contents: write | |
| actions: none | |
| checks: none | |
| deployments: none | |
| issues: none | |
| discussions: none | |
| packages: none | |
| pull-requests: none | |
| repository-projects: none | |
| security-events: none | |
| statuses: none | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4 | |
| with: | |
| persist-credentials: false | |
| - name: Download changed .pre-commit-config.yaml | |
| uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 | |
| with: | |
| name: ".pre-commit-config.yaml" | |
| - uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7 | |
| if: always() | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| sign-commits: true | |
| branch: update/pre-commit-hooks | |
| delete-branch: true | |
| labels: dependencies | |
| title: "Update pre-commit hooks" | |
| commit-message: "chore: update pre-commit hooks" | |
| body: Update versions of pre-commit hooks to the latest version. | |
| add-paths: ".pre-commit-config.yaml" |