From 38db5dd0af1e70c2a1a56fc442e3dca0142af834 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 01:13:28 +0000 Subject: [PATCH 1/6] build: update pre-commit hooks --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 965612070d..00d348672d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,12 +22,12 @@ repos: exclude: \.dot$ - id: debug-statements - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.7 + rev: v0.6.8 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - repo: https://github.com/pre-commit/mirrors-eslint - rev: v8.56.0 + rev: v9.11.1 hooks: - id: eslint args: [--fix, --color] @@ -36,7 +36,7 @@ repos: - eslint-plugin-react@7.34.0 - react@18.3.1 - repo: https://github.com/crate-ci/typos - rev: v1.23.6 + rev: v1.24.6 hooks: - id: typos exclude: | From a78467b6974089f67173a8e6f44c33944db1724c Mon Sep 17 00:00:00 2001 From: David Wallace Date: Fri, 11 Oct 2024 11:54:54 +0200 Subject: [PATCH 2/6] build(pre-commit): autoupdate hooks and update eslint-plugin-react Signed-off-by: David Wallace --- .pre-commit-config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 00d348672d..1194e37b64 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: hooks: - id: check-hooks-apply - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: check-ast - id: check-json @@ -22,21 +22,21 @@ repos: exclude: \.dot$ - id: debug-statements - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.8 + rev: v0.6.9 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - repo: https://github.com/pre-commit/mirrors-eslint - rev: v9.11.1 + rev: v9.12.0 hooks: - id: eslint args: [--fix, --color] additional_dependencies: - eslint@8.56.0 - - eslint-plugin-react@7.34.0 + - eslint-plugin-react@7.37.0 - react@18.3.1 - repo: https://github.com/crate-ci/typos - rev: v1.24.6 + rev: v1.26.0 hooks: - id: typos exclude: | From a2ecba848c2654635a5c62e994e4d2ef0473500e Mon Sep 17 00:00:00 2001 From: David Wallace Date: Fri, 11 Oct 2024 12:03:25 +0200 Subject: [PATCH 3/6] build(pre-commit): add pre-commit.ci config Signed-off-by: David Wallace --- .pre-commit-config.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1194e37b64..edbcefd52a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -49,3 +49,7 @@ repos: testing/.*.json| testing/.*.xml )$ +ci: + autoupdate_schedule: monthly + autofix_prs: false + autoupdate_branch: 'dependency-updates' From 7714e1d04d072727a8a3c7be323c802b522c6889 Mon Sep 17 00:00:00 2001 From: David Wallace Date: Fri, 11 Oct 2024 12:05:05 +0200 Subject: [PATCH 4/6] docs: add pre-commit.ci badge to README.md Signed-off-by: David Wallace --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index fd40122546..b629b4c110 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ RDMO - Research Data Management Organiser [![Django Versions](https://img.shields.io/pypi/frameworkversions/django/rdmo)](https://pypi.python.org/pypi/rdmo/) [![License](https://img.shields.io/github/license/rdmorganiser/rdmo?style=flat)](https://github.com/rdmorganiser/rdmo/blob/main/LICENSE) \ [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit) +[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/rdmorganiser/rdmo/main.svg)](https://results.pre-commit.ci/latest/github/rdmorganiser/rdmo/main) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![CI Workflow Status](https://github.com/rdmorganiser/rdmo/actions/workflows/ci.yml/badge.svg)](https://github.com/rdmorganiser/rdmo/actions/workflows/ci.yml) [![Coverage Status](https://coveralls.io/repos/rdmorganiser/rdmo/badge.svg?branch=main&service=github)](https://coveralls.io/github/rdmorganiser/rdmo?branch=main) From 0da46ccd84d048858b2a8173d860da1d9d58b255 Mon Sep 17 00:00:00 2001 From: David Wallace Date: Fri, 11 Oct 2024 15:58:26 +0200 Subject: [PATCH 5/6] build(pre-commit): add commit msg to autoupdate config Signed-off-by: David Wallace --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index edbcefd52a..4010ed5487 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -53,3 +53,4 @@ ci: autoupdate_schedule: monthly autofix_prs: false autoupdate_branch: 'dependency-updates' + autoupdate_commit_msg: 'build(pre-commit): pre-commit autoupdate by ci' From 228308845bd69722c9ca5aa8f6c3e9c2834ed3d2 Mon Sep 17 00:00:00 2001 From: David Wallace Date: Fri, 11 Oct 2024 17:04:43 +0200 Subject: [PATCH 6/6] ci: remove pre-commit-autoupdate workflow and related types array Signed-off-by: David Wallace # Conflicts: # .github/workflows/pre-commit-autoupdate.yml --- .github/workflows/ci.yml | 5 -- .github/workflows/pre-commit-autoupdate.yml | 62 --------------------- 2 files changed, 67 deletions(-) delete mode 100644 .github/workflows/pre-commit-autoupdate.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58c4865cf2..255aff784f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,11 +17,6 @@ on: - conftest.py - package.json - pyproject.toml - types: - - opened - - synchronize - - reopened - - ready_for_review # this is needed to trigger checks, when an auto-generated "draft" PR is set for "ready for review". # Ref: https://docs.github.com/en/actions/using-jobs/using-concurrency concurrency: diff --git a/.github/workflows/pre-commit-autoupdate.yml b/.github/workflows/pre-commit-autoupdate.yml deleted file mode 100644 index 42939988c2..0000000000 --- a/.github/workflows/pre-commit-autoupdate.yml +++ /dev/null @@ -1,62 +0,0 @@ -# This CI job is adapted from: -# Cookiecutter Django (2013-10-17), BSD-3-Clause license -# Ref: https://github.com/cookiecutter/cookiecutter-django/blob/2023.10.17/.github/workflows/pre-commit-autoupdate.yml - -name: Update pre-commit hooks - -on: - schedule: - # run once a month at midnight of the first day of the month - - cron: 0 0 1 * * - # run manually from actions tab - workflow_dispatch: - -permissions: - contents: read - -jobs: - auto-update: - # Disables this workflow from running in a repository that is not part of the indicated organization/user - if: github.repository_owner == 'rdmorganiser' - permissions: - contents: write # for peter-evans/create-pull-request to create branch - pull-requests: write # for peter-evans/create-pull-request to create a PR - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.12" - cache: pip - - run: python -m pip install pre-commit - - run: pre-commit autoupdate > autoupdate.log - - name: Prepare message for pr body - run: | - grep "updating" autoupdate.log > updates.log - sed -i -e 's/\[/- /g' updates.log - echo -e "## Proposed changes\n\nBumps the pre-commit config with the following updates:\n" > pr-body.md - cat updates.log >> pr-body.md - echo -e "\nThis PR is auto-generated once a month.\n\n---" >> pr-body.md - echo -e "\n> [!NOTE]\n> Mark this PR as "ready for review" to trigger additional checks." >> pr-body.md - # Ref: https://github.com/peter-evans/create-pull-request - - name: Create pull request - uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5 - with: - branch: pre-commit-autoupdate - base: dependency-updates - committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> - author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> - title: "build: update pre-commit hooks" - commit-message: "build: update pre-commit hooks" - add-paths: .pre-commit-config.yaml - body-path: pr-body.md - labels: | - dependencies - pre-commit - type:maintenance - delete-branch: true - draft: true - - name: Write to job summary - run: | - cat updates.log >> $GITHUB_STEP_SUMMARY