From 2bd0058e5d64c4f4328594979b929fd03c304786 Mon Sep 17 00:00:00 2001 From: Maryam Tahhan Date: Mon, 25 Nov 2024 05:00:23 -0500 Subject: [PATCH] chore: update pre-commit hooks Run pre-commit autoupdate and add a monthly workflow to update hooks. Signed-off-by: Maryam Tahhan --- .github/workflows/pre-commit-auto-update.yml | 31 ++++++++++++++++++++ .pre-commit-config.yaml | 10 +++---- 2 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/pre-commit-auto-update.yml diff --git a/.github/workflows/pre-commit-auto-update.yml b/.github/workflows/pre-commit-auto-update.yml new file mode 100644 index 0000000000..598ec477ee --- /dev/null +++ b/.github/workflows/pre-commit-auto-update.yml @@ -0,0 +1,31 @@ +name: Pre-commit auto-update + +on: # yamllint disable-line rule:truthy + schedule: + - cron: 0 0 1 * * + +jobs: + auto-update: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + + - name: Install pre-commit + run: pip install pre-commit + + - name: Run pre-commit autoupdate + run: pre-commit autoupdate + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v7 + with: + token: ${{ secrets.GITHUB_TOKEN }} + branch: update/pre-commit-autoupdate + title: Auto-update pre-commit hooks + commit-message: Auto-update pre-commit hooks + body: | + Update pre-commit hooks to latest version + labels: dependencies diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4a07cc209e..d2a84ced41 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -12,12 +12,12 @@ repos: hooks: - id: yamllint - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v17.0.6 + rev: v19.1.4 hooks: - id: clang-format types_or: [c] - repo: https://github.com/DavidAnson/markdownlint-cli2 - rev: v0.9.2 + rev: v0.15.0 hooks: - id: markdownlint-cli2-rules-docker - repo: https://github.com/codespell-project/codespell @@ -28,11 +28,11 @@ repos: additional_dependencies: - tomli - repo: https://github.com/golangci/golangci-lint - rev: v1.61.0 + rev: v1.62.0 hooks: - id: golangci-lint - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook - rev: v9.16.0 + rev: v9.18.0 hooks: - id: commitlint stages: [commit-msg]