Pre-commit auto-update #434
This file contains 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
--- | |
# Check if precommit packages need to be updated and create PR if this is the case | |
name: Pre-commit auto-update | |
on: # yamllint disable-line rule:truthy | |
workflow_dispatch: | |
schedule: | |
# https://crontab.cronhub.io/ | |
- cron: "30 10 * * *" | |
jobs: | |
auto-update: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: Install pre-commit | |
run: pip install pre-commit | |
- name: Run pre-commit autoupdate | |
run: pre-commit autoupdate | |
- uses: crazy-max/ghaction-import-gpg@v6 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
- uses: tibdex/github-app-token@v2 | |
id: generate-token | |
with: | |
app_id: ${{ secrets.APP_ID }} | |
private_key: ${{ secrets.APP_PRIVATE_KEY }} | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
committer: fchastanet <[email protected]> | |
branch: update/pre-commit-autoupdate | |
title: Auto-update pre-commit hooks | |
commit-message: Auto-update pre-commit hooks | |
body: | | |
Update versions of tools in pre-commit | |
configs to latest version | |
labels: dependencies |