Skip to content

Pre-commit auto-update #107

Pre-commit auto-update

Pre-commit auto-update #107

---
# 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 22 1 */3 *"
jobs:
auto-update:
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true # Forces Node 24 runtime
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.12
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit autoupdate
uses: j178/prek-action@v2
id: preCommit
with:
extra-args: >-
autoupdate
- uses: crazy-max/ghaction-import-gpg@v7
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- uses: actions/create-github-app-token@v3.1.1
if: ${{ success() }}
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@v8
with:
token: ${{ steps.generate-token.outputs.token }}
committer: fchastanet <237869+fchastanet@users.noreply.github.com>
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