From 9fed0a046dd5980cd9e679217b2154dce0217c2d Mon Sep 17 00:00:00 2001 From: Patrick Niebeling Date: Tue, 17 Nov 2026 19:21:15 +0100 Subject: [PATCH] Add Renovate for dependency updates Co-Authored-By: Claude Sonnet 5.5 --- .gitea/workflows/renovate.yml | 32 ++++++++++++++++++++++++++++++++ AGENTS.md | 2 +- docs/operations.md | 12 ++++++++++++ renovate.json | 30 ++++++++++++++++++++++++++++++ 4 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/renovate.yml create mode 100644 renovate.json diff --git a/.gitea/workflows/renovate.yml b/.gitea/workflows/renovate.yml new file mode 100644 index 0000000..4b791ae --- /dev/null +++ b/.gitea/workflows/renovate.yml @@ -0,0 +1,32 @@ +# Dependency updates with Renovate (Composer packages, Docker base images, workflow actions). +# +# Runs daily and on demand. Renovate opens pull requests on `renovate/*` branches; the normal CI +# (ci.yml, job `test`) runs on them, and they are merged by hand like every other PR. +# Rules live in renovate.json. Renovate is restricted to this repository (no autodiscovery). +# +# Repository secret (Settings → Actions → Secrets): +# RENOVATE_TOKEN Gitea access token with scopes repository (read/write), issue (read/write), +# user (read); plus organization (read) if the repo belongs to an organization. +name: Renovate + +on: + schedule: + - cron: '0 4 * * *' + workflow_dispatch: + +jobs: + renovate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Run Renovate + uses: renovatebot/github-action@v46.3.10 + with: + token: ${{ secrets.RENOVATE_TOKEN }} + env: + RENOVATE_PLATFORM: gitea + RENOVATE_ENDPOINT: ${{ gitea.server_url }}/api/v1 + RENOVATE_REPOSITORIES: ${{ gitea.repository }} + RENOVATE_GIT_AUTHOR: Renovate Bot + LOG_LEVEL: info diff --git a/AGENTS.md b/AGENTS.md index e2f6a54..ae36aef 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -56,7 +56,7 @@ passende Dokument und pflegt es danach** (Details zu Verhalten, Settings, Tests | Live-Schaltung, Referentenansicht, Pause, Ausblenden, Zurücksetzen, Duplizieren, Einbettung, internes Feedback | [docs/presenter.md](docs/presenter.md) | | Dashboard-Fragmente, Farbschema, Textformatierung, Vollbild | [docs/frontend.md](docs/frontend.md) | | PDF-Export | [docs/pdf-export.md](docs/pdf-export.md) | -| Ablauf/Cleanup von Umfragen, CI/Deploy, Releases, Docker | [docs/operations.md](docs/operations.md) | +| Ablauf/Cleanup von Umfragen, CI/Deploy, Releases, Docker, Renovate | [docs/operations.md](docs/operations.md) | | Betreiber-Anleitung (Docker, Cronjob, Releases) und Umgebungsvariablen | [docs/deployment.md](docs/deployment.md), [docs/configuration.md](docs/configuration.md) | ## Architektur in Kürze diff --git a/docs/operations.md b/docs/operations.md index 690e622..3f780d6 100644 --- a/docs/operations.md +++ b/docs/operations.md @@ -37,6 +37,18 @@ Deploy erfolgt über Git (Remote: Gitea) mit `.gitea/workflows/ci.yml`: - Benötigte Variablen/Secrets sind im Kopf der Workflow-Datei dokumentiert. Zugangsdaten nur als Gitea-Secret, nie ins Repo. +## Abhängigkeiten (Renovate) + +`.gitea/workflows/renovate.yml` startet täglich (04:00 UTC) und manuell ([Actions → Renovate → Run workflow]) Renovate. +Es prüft Composer-Pakete (CakePHP-Version und Plugins), Docker-Basisimages und Actions in den Workflows und legt +PRs auf `renovate/*`-Branches an; dort läuft die normale CI, gemergt wird von Hand. Regeln in `renovate.json`: +CakePHP-Pakete in einem PR (auch das nächste Minor, da `5.4.*` gepinnt ist), Dev-Tools gebündelt, `composer.lock`-Pflege +montags, die PHP-Constraint wird nie automatisch angehoben. Außerdem pflegt Renovate das Issue „Dependency Dashboard“ +mit allen offenen Updates. Das Secret `RENOVATE_TOKEN` (Gitea-Token mit `repository`, `issue`, `user`) liegt nur in den +Repo-Secrets, nie im Repo. Renovate ist per `RENOVATE_REPOSITORIES` auf dieses Repo beschränkt. Läuft unter dem Token-Besitzer +(PRs erscheinen unter dessen Namen, ohne Benachrichtigung für ihn); ein eigener Bot-Account lässt sich später durch Austausch +des Secrets einsetzen. + ## Container (Docker) **Container (Docker) – nur für Testzwecke, nicht für den Produktivbetrieb geeignet** (eingebauter PHP-Server, SQLite; das steht diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..f38922f --- /dev/null +++ b/renovate.json @@ -0,0 +1,30 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["config:recommended"], + "timezone": "Europe/Berlin", + "labels": ["dependencies"], + "prConcurrentLimit": 5, + "lockFileMaintenance": { + "enabled": true, + "schedule": ["before 6am on monday"] + }, + "packageRules": [ + { + "description": "CakePHP core and its official plugins in one PR (also proposes the next minor, e.g. 5.4.* -> 5.5.*)", + "matchPackageNames": ["cakephp/**"], + "groupName": "CakePHP", + "rangeStrategy": "replace" + }, + { + "description": "Dev tools (phpunit, phpcs, bake, debug_kit) as one PR", + "matchDepTypes": ["require-dev"], + "groupName": "dev dependencies", + "excludePackageNames": ["cakephp/**"] + }, + { + "description": "Keep the PHP constraint in step with the CI matrix; never bump it automatically", + "matchPackageNames": ["php"], + "enabled": false + } + ] +}