diff --git a/.github/renovate.json5 b/.github/renovate.json5 index eee6af1..5496477 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -17,6 +17,8 @@ labels: ["automerge-security-update"], }, osvVulnerabilityAlerts: true, + // Kept inline (not via "local>.") because renovate-deps.py runs with + // --platform=local which cannot resolve local presets. customManagers: [ { customType: "regex", diff --git a/README.md b/README.md index f586a10..d9987ec 100644 --- a/README.md +++ b/README.md @@ -169,28 +169,20 @@ Linters that don't support autofix (like lychee link checker) silently ignore th ## Automatic version updates with Renovate -To let Renovate automatically update the pinned flint version in your -`mise.toml`, add this custom manager to your `renovate.json5`: +Flint provides a [Renovate shareable preset](https://docs.renovatebot.com/config-presets/) +with custom managers that automatically update: + +- **Pinned flint versions** in `mise.toml` (`raw.githubusercontent.com` URLs) +- **`_VERSION` variables** in `mise.toml` (e.g., `SUPER_LINTER_VERSION`) + +Add this to your `renovate.json5`: ```json5 { - customManagers: [ - { - customType: "regex", - description: "Update raw.githubusercontent.com version tags in mise.toml", - managerFilePatterns: ["/^mise\\.toml$/"], - matchStrings: [ - "https://raw\\.githubusercontent\\.com/(?[^/]+/[^/]+)/(?v[^/]+)/", - ], - datasourceTemplate: "github-tags", - }, - ], + extends: ["github>grafana/flint"], } ``` -This matches all `raw.githubusercontent.com` URLs in `mise.toml` and updates -the version tag (e.g., `v0.1.0`) when a new release is published. - ## Per-repo configuration Each task expects certain config files that your repository must provide. You only need the files for the tasks you adopt: diff --git a/default.json b/default.json new file mode 100644 index 0000000..92a0926 --- /dev/null +++ b/default.json @@ -0,0 +1,30 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "description": "Renovate custom managers for repositories that use flint mise tasks", + "customManagers": [ + { + "customType": "regex", + "description": "Update _VERSION variables in mise.toml", + "managerFilePatterns": ["/^mise\\.toml$/"], + "matchStrings": [ + "# renovate: datasource=(?[a-z-]+?)(?: depName=(?.+?))?(?: packageName=(?.+?))?(?: versioning=(?[a-z-]+?))?\\s.+?_VERSION=\"?(?[^@\"]+?)(?:@(?sha256:[a-f0-9]+))?\"?\\s" + ] + }, + { + "customType": "regex", + "description": "Update raw.githubusercontent.com version tags in mise.toml", + "managerFilePatterns": ["/^mise\\.toml$/"], + "matchStrings": [ + "https://raw\\.githubusercontent\\.com/(?[^/]+/[^/]+)/(?v[^/]+)/" + ], + "datasourceTemplate": "github-tags" + } + ], + "packageRules": [ + { + "matchPackageNames": ["renovate"], + "description": "Only update renovate once a week", + "schedule": ["before 6am on Monday"] + } + ] +}