From d570dbf41f99a1e22329993bc4ca1f048a301440 Mon Sep 17 00:00:00 2001 From: Daan Selen Date: Fri, 5 Jun 2026 20:26:49 +0200 Subject: [PATCH] feat: init commit --- .gitea/workflows/renovate.yml | 22 ++++++++ LICENSE | 10 ++++ README.md | 94 +++++++++++++++++++++++++++++++++++ config.js | 12 +++++ default.json | 9 ++++ go-deps.json | 24 +++++++++ npm-deps.json | 21 ++++++++ renovate.json | 23 +++++++++ security.json | 7 +++ workflow-deps.json | 12 +++++ 10 files changed, 234 insertions(+) create mode 100644 .gitea/workflows/renovate.yml create mode 100644 LICENSE create mode 100644 README.md create mode 100644 config.js create mode 100644 default.json create mode 100644 go-deps.json create mode 100644 npm-deps.json create mode 100644 renovate.json create mode 100644 security.json create mode 100644 workflow-deps.json diff --git a/.gitea/workflows/renovate.yml b/.gitea/workflows/renovate.yml new file mode 100644 index 0000000..5bb5157 --- /dev/null +++ b/.gitea/workflows/renovate.yml @@ -0,0 +1,22 @@ +name: renovate + +on: + schedule: + - cron: "@daily" + push: + branches: + - main + workflow_dispatch: + +jobs: + renovate: + runs-on: ubuntu-latest + container: ghcr.io/renovatebot/renovate:43.191.2 + steps: + - uses: actions/checkout@v6 + - run: renovate + env: + RENOVATE_CONFIG_FILE: "/workspace/daanselen/renovate-config/config.js" + LOG_LEVEL: "debug" + RENOVATE_CONFIG_MIGRATION: "true" + RENOVATE_TOKEN: ${{ secrets.GITEA_TOKEN }} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f1d7c16 --- /dev/null +++ b/LICENSE @@ -0,0 +1,10 @@ +MIT License + +Copyright (c) 2023 gitea +Copyright (c) 2024 DaanSelen + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..c0080f9 --- /dev/null +++ b/README.md @@ -0,0 +1,94 @@ +# renovate-config + +To host the renovate config. + +- `config.js` holds the self-hosted Renovate configuration so that Renovate knows what and how it should process. +- `renovate.json` in this repository ensures to receive Renovate updates. +- `default.json` holds the basic config for all repositories. It extends the presets by the renovate project defined in `renovate-schema.json`. +- Each repository can extend/alter this config by adding a `renovate.json` file to the root of the repository. + +## Reusable presets + +### Golang dependency group + +What it does: + +- Groups all Golang dependencies into one PR + - Respects your repository's `separateMajorMinor` setting[^1] +- Runs `go mod tidy` before committing to ensure a clean `go.sum`[^2] + +Usage: + +```diff +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "local>daanselen/renovate-config", ++ "local>daanselen/renovate-config:go-deps" + ] +} +``` + +### NPM dependency group + +What it does: + +- Groups all NPM dependencies[^3] into one PR + - Respects your repository's `separateMajorMinor` setting[^1] +- Groups all NPM dev-dependencies[^3] into one PR + - Respects your repository's `separateMajorMinor` setting[^1] + +Usage: + +```diff +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "local>daanselen/renovate-config", ++ "local>daanselen/renovate-config:npm-deps" + ] +} +``` + +### Workflow dependency group + +What it does: + +- Groups all workflow dependencies into one PR + - Respects your repository's `separateMajorMinor` setting[^1] + +Usage: + +```diff +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "local>daanselen/renovate-config", ++ "local>daanselen/renovate-config:workflow-deps" + ] +} +``` + +### Security fixes + +What it does: + +- Bumps a dependency to resolve a vulnerability[^4] + - Overrules any scheduling and grouping for that vulnerability + +Usage: + +```diff +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "local>daanselen/renovate-config", ++ "local>daanselen/renovate-config:security" + ] +} +``` + +[^1]: [Renovate Docs: separateMajorMinor](https://docs.renovatebot.com/configuration-options/#separatemajorminor) +[^2]: [Renovate Docs: postUpdateOptions](https://docs.renovatebot.com/configuration-options/#postupdateoptions) +[^3]: [Renovate Docs: npm dependency types](https://docs.renovatebot.com/modules/manager/npm/#additional-information) +[^4]: [Renovate Docs: osv vulnerabilities](https://docs.renovatebot.com/configuration-options/#osvvulnerabilityalerts) and [Renovate Docs: vulnerabilityAlerts](https://docs.renovatebot.com/configuration-options/#vulnerabilityalerts) diff --git a/config.js b/config.js new file mode 100644 index 0000000..7d7821b --- /dev/null +++ b/config.js @@ -0,0 +1,12 @@ +module.exports = { + "endpoint": "https://gitea.nerthus.nl/api/v1", + "gitAuthor": "Renovate Bot ", + "platform": "gitea", + "onboardingConfigFileName": "renovate.json5", + "autodiscover": true, + "autodiscoverFilter": ["daanselen/*"], + "optimizeForDisabled": true, + "forkProcessing": "disabled", + "dryRun": null, + "binarySource": "install" +}; diff --git a/default.json b/default.json new file mode 100644 index 0000000..4076f6f --- /dev/null +++ b/default.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["config:recommended","local>daanselen/renovate-config:workflow-deps"], + "configMigration": true, + "minimumReleaseAge": "5 days", + "semanticCommits": "enabled", + "automergeStrategy": "auto", + "platformAutomerge": false +} diff --git a/go-deps.json b/go-deps.json new file mode 100644 index 0000000..8528c8c --- /dev/null +++ b/go-deps.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "gomod": { + "enabled": true + }, + "postUpdateOptions": [ + "gomodTidy", + "gomodUpdateImportPaths" + ], + "packageRules": [ + { + "groupName": "Go dependencies", + "matchManagers": ["gomod"] + }, + { + "description": "Bump the toolchain directive immediately", + "matchManagers": ["gomod"], + "matchDepTypes": ["toolchain"], + "rangeStrategy": "bump", + "schedule": ["at any time"], + "minimumReleaseAge": "0" + } + ] +} diff --git a/npm-deps.json b/npm-deps.json new file mode 100644 index 0000000..de32951 --- /dev/null +++ b/npm-deps.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "npm": { + "enabled": true + }, + "postUpdateOptions": [ + "pnpmDedupe" + ], + "packageRules": [ + { + "groupName": "npm dependencies", + "matchManagers": ["npm"], + "matchDepTypes": ["dependencies"] + }, + { + "groupName": "npm dev-dependencies", + "matchManagers": ["npm"], + "matchDepTypes": ["devDependencies"] + } + ] +} diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..3441f02 --- /dev/null +++ b/renovate.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["daanselen/renovate-config"], + "dependencyDashboard": true, + "enabledManagers": [ + "github-actions" + ], + "automerge": true, + "ignoreTests": true, + "packageRules": [ + { + "description": "use fix scope for renovate updates", + "matchPackageNames": ["renovatebot/renovate"], + "semanticCommitType": "fix" + }, + { + "description": "Automerge renovate updates", + "matchPackageNames": ["renovatebot/renovate"], + "matchUpdateTypes": ["minor", "patch", "digest"], + "automerge": true + } + ] +} diff --git a/security.json b/security.json new file mode 100644 index 0000000..4818cd2 --- /dev/null +++ b/security.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "osvVulnerabilityAlerts": true, + "vulnerabilityAlerts": { + "enabled": true + } +} diff --git a/workflow-deps.json b/workflow-deps.json new file mode 100644 index 0000000..cc8e7f6 --- /dev/null +++ b/workflow-deps.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "github-actions": { + "enabled": true + }, + "packageRules": [ + { + "groupName": "workflow dependencies", + "matchManagers": ["github-actions"] + } + ] +}