From aaa4571826e5b89e80c618a4a9153210ea0705c1 Mon Sep 17 00:00:00 2001 From: Dan Saunders Date: Thu, 20 Mar 2025 10:15:19 -0400 Subject: [PATCH] adding pre-commit auto-update GH action and bumping plugin versions --- .github/workflows/precommit-autoupdate.yml | 49 ++++++++++++++++++++++ .pre-commit-config.yaml | 16 +++---- 2 files changed, 57 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/precommit-autoupdate.yml diff --git a/.github/workflows/precommit-autoupdate.yml b/.github/workflows/precommit-autoupdate.yml new file mode 100644 index 000000000..921742211 --- /dev/null +++ b/.github/workflows/precommit-autoupdate.yml @@ -0,0 +1,49 @@ +name: Pre-commit auto-update + +on: + schedule: + - cron: '0 0 * * 0' # Run weekly + workflow_dispatch: # Manual kickoff + +jobs: + auto-update: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Update pre-commit hooks + id: update + run: | + pip install pre-commit + pre-commit autoupdate + if [[ -n $(git status --porcelain) ]]; then + echo "changes=true" >> $GITHUB_OUTPUT + git diff .pre-commit-config.yaml > pre-commit-update.diff + fi + + - name: Create Pull Request + if: steps.update.outputs.changes == 'true' + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + branch: update/pre-commit-hooks + delete-branch: true + title: "chore: update pre-commit hooks" + commit-message: "chore: update pre-commit hooks" + body: | + Automated PR to update pre-commit hooks to their latest versions. + +
+ Changes: + + ```diff + ${{ steps.update.outputs.diff }} + ``` +
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 95a6e99a0..7cfab6227 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ default_language_version: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v5.0.0 hooks: - id: check-yaml - id: end-of-file-fixer @@ -11,23 +11,23 @@ repos: - id: no-commit-to-branch args: ['--branch', 'main'] - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 25.1.0 hooks: - id: black - repo: https://github.com/pycqa/isort - rev: 5.12.0 + rev: 6.0.1 hooks: - id: isort - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 + rev: 7.1.2 hooks: - id: flake8 -- repo: https://github.com/pylint-dev/pylint - rev: c8c96d20cde3552a79858c7456bb1483bf83d633 +- repo: https://github.com/PyCQA/pylint + rev: v3.3.6 hooks: - id: pylint - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.3.0 + rev: v1.15.0 hooks: - id: mypy additional_dependencies: @@ -36,7 +36,7 @@ repos: 'pydantic>=2.5.3', ] - repo: https://github.com/PyCQA/bandit - rev: 1.7.5 + rev: 1.8.3 hooks: - id: bandit args: [