From 6f425e2a0c7c95b27b05fd38a3f4e3e801356ae9 Mon Sep 17 00:00:00 2001 From: Daniel D Date: Mon, 19 Jan 2026 11:06:53 +0100 Subject: [PATCH] Precommit updates differently --- .github/dependabot.yml | 4 -- .github/workflows/pre-commit-autoupdate.yml | 44 +++++++++++++++++++++ 2 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/pre-commit-autoupdate.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9e41c9b4..b728efb6 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,7 +8,3 @@ updates: directory: "/" schedule: interval: "daily" - - package-ecosystem: "pre-commit" - directory: "/" - schedule: - interval: "daily" diff --git a/.github/workflows/pre-commit-autoupdate.yml b/.github/workflows/pre-commit-autoupdate.yml new file mode 100644 index 00000000..688a9b39 --- /dev/null +++ b/.github/workflows/pre-commit-autoupdate.yml @@ -0,0 +1,44 @@ +name: Pre-commit autoupdate + +on: + schedule: + - cron: "0 3 * * 1" + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +jobs: + autoupdate: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "3.10" + + - name: Install pre-commit + run: | + python -m pip install --upgrade pip + pip install pre-commit + + - name: Run pre-commit autoupdate + run: | + pre-commit autoupdate + + - name: Set date for PR metadata + run: | + echo "PR_DATE=$(date +%Y-%m-%d)" >> "$GITHUB_ENV" + + - name: Create pull request + uses: peter-evans/create-pull-request@v6 + with: + commit-message: "chore: pre-commit autoupdate (${PR_DATE})" + title: "chore: pre-commit autoupdate (${PR_DATE})" + body: "Automated pre-commit autoupdate (${PR_DATE})." + branch: "chore/pre-commit-autoupdate-${PR_DATE}" + delete-branch: true