From 3676514ba6a395cd7154681ddf09c59eca23f689 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 21 Dec 2023 19:18:50 +0100 Subject: [PATCH] Add pre-commit auto-update workflow --- .github/workflows/pre-commit-update.yml | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/pre-commit-update.yml diff --git a/.github/workflows/pre-commit-update.yml b/.github/workflows/pre-commit-update.yml new file mode 100644 index 000000000..00c2cabcb --- /dev/null +++ b/.github/workflows/pre-commit-update.yml @@ -0,0 +1,37 @@ +name: Pre-commit auto-update + +on: + # every day at midnight + schedule: + - cron: "0 3 * * 2" + # on demand + workflow_dispatch: + +permissions: + pull-requests: write + +jobs: + auto-update: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + + - name: Install pre-commit + run: pip install pre-commit + + - name: Run auto-update + run: pre-commit autoupdate + + - name: Run pre-commit + run: pre-commit run --all-files + + - uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + add-paths: .pre-commit-config.yaml + branch: update/pre-commit-hooks + title: Update pre-commit hooks + commit-message: "chore: update pre-commit hooks" + body: Update versions of pre-commit hooks to latest version.