From 49ab01f89eb0b226edab7c3224a7d69c21e09d4a Mon Sep 17 00:00:00 2001 From: Philipp Horstenkamp Date: Fri, 24 Nov 2023 22:21:59 +0100 Subject: [PATCH 1/3] Add .gitea/workflows/lint.yaml --- .gitea/workflows/lint.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .gitea/workflows/lint.yaml diff --git a/.gitea/workflows/lint.yaml b/.gitea/workflows/lint.yaml new file mode 100644 index 0000000..2fb68df --- /dev/null +++ b/.gitea/workflows/lint.yaml @@ -0,0 +1,18 @@ +name: Auto Maintenance Cycle + +on: + push: + workflow_dispatch: + +jobs: + pre-commit-lint: + name: pre-commit Linting + runs-on: pi + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + - run: pip install pre-commit + shell: bash + - name: Pre Commit + run: SKIP=no-commit-to-branch pre-commit run -a + shell: bash -- 2.47.2 From c89587afe94540dbd0de4ed581ea8b2812db39fe Mon Sep 17 00:00:00 2001 From: Philipp Horstenkamp Date: Fri, 24 Nov 2023 22:22:55 +0100 Subject: [PATCH 2/3] Add .pre-commit-config.yaml --- .pre-commit-config.yaml | 50 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..30e6314 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,50 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: end-of-file-fixer + exclude: (.txt$|.ipynb$|README.md$|readme.mde$) + - id: trailing-whitespace + exclude: (.txt$|README.md$) + - id: check-yaml + - id: check-json + - id: check-toml + - id: check-xml + - id: check-added-large-files + args: [--enforce-all] + - id: name-tests-test + - id: detect-private-key + - id: check-case-conflict + - id: check-symlinks + - id: check-docstring-first + - id: pretty-format-json + args: [--autofix, --no-sort-keys, --no-ensure-ascii] + - id: check-merge-conflict + - id: no-commit-to-branch + args: [--branch, main] + +- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks + rev: v2.11.0 + hooks: + - id: pretty-format-ini + args: [--autofix] + - id: pretty-format-toml + args: [--autofix] + - id: pretty-format-yaml + args: [--autofix] + +- repo: https://github.com/frnmst/md-toc + rev: 8.2.0 + hooks: + - id: md-toc + +- repo: https://github.com/Lucas-C/pre-commit-hooks-java + rev: 1.3.10 + hooks: + - id: validate-html + +- repo: https://github.com/pre-commit/mirrors-prettier + rev: v3.1.0 + hooks: + - id: prettier + types_or: [css, javascript] -- 2.47.2 From 6dbd4b2a9e77465d3efe36225cbe1e21bd7e17a3 Mon Sep 17 00:00:00 2001 From: Philipp Horstenkamp Date: Fri, 24 Nov 2023 22:23:58 +0100 Subject: [PATCH 3/3] Add .gitea/workflows/maintenance.yaml --- .gitea/workflows/maintenance.yaml | 45 +++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .gitea/workflows/maintenance.yaml diff --git a/.gitea/workflows/maintenance.yaml b/.gitea/workflows/maintenance.yaml new file mode 100644 index 0000000..5a6cf96 --- /dev/null +++ b/.gitea/workflows/maintenance.yaml @@ -0,0 +1,45 @@ +name: Auto Maintenance Cycle + +on: + push: + paths: + - .gitea/workflows/maintenance.yaml + schedule: + - cron: 0 1 * * 0 + workflow_dispatch: + +jobs: + auto-update: + name: pre-commit Autoupdate + runs-on: pi64 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + + - run: pip install pre-commit + shell: bash + - run: pre-commit autoupdate + shell: bash + - name: Test pre-commit + run: pre-commit run -a + - name: Commit + id: auto-commit-action + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: 'chore: update pre-commit hooks' + branch: update/pre-commit-hooks + push_options: --force + create_branch: true + - name: Generate Date + run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + - run: echo "${{steps.auto-commit-action.outputs.changes_detected}}" + - name: Create an PR action + if: steps.auto-commit-action.outputs.changes_detected == 'true' + uses: https://git.horstenkamp.eu/Philipp/gitea-act-create-pr@main + with: + token: ${{ secrets.REPO_TOKEN }} + branch: update/pre-commit-hooks + title: Updates to the pre-commit action created at ${{ env.CURRENT_DATE }} + body: Update to the pre-commit action. + assignees: Philipp + reviewers: Philipp -- 2.47.2