Skip to content

Commit

Permalink
add custom versioning matchers (#305)
Browse files Browse the repository at this point in the history
* add custom versioning matchers

* keep it simple for now

* add few more

* do some migrations, based on renovate logs suggestion

* use function instead of arrow function, to be on the safe side

* add scheduling
  • Loading branch information
stavros-k authored Aug 29, 2024
1 parent de7fa88 commit 27cef5c
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 3 deletions.
46 changes: 43 additions & 3 deletions .github/renovate-config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
extends: [],
// https://docs.renovatebot.com/self-hosted-configuration/#dryrun
dryRun: false,
dryRun: null,
// https://docs.renovatebot.com/configuration-options/#gitauthor
gitAuthor: "bugclerk <[email protected]>",
// https://docs.renovatebot.com/self-hosted-configuration/#onboarding
Expand All @@ -17,9 +17,10 @@ module.exports = {
// https://docs.renovatebot.com/self-hosted-configuration/#allowedpostupgradecommands
// TODO: Restrict this.
allowedPostUpgradeCommands: ["^.*"],
enabledManagers: ["regex", "github-actions"],
enabledManagers: ["custom.regex", "github-actions"],
customManagers: [
{
customType: "regex",
// Match only ix_values.yaml files in the ix-dev directory
fileMatch: ["^ix-dev/.*/ix_values\\.yaml$"],
// Matches the repository name and the tag of each image
Expand All @@ -32,7 +33,7 @@ module.exports = {
],
packageRules: [
{
matchManagers: ["regex"],
matchManagers: ["custom.regex"],
matchDatasources: ["docker"],
postUpgradeTasks: {
// What to "git add" after the commands are run
Expand Down Expand Up @@ -64,5 +65,44 @@ module.exports = {
groupName: "updates-patch-minor",
labels: ["patch"],
},
// Custom versioning matching
customVersioning(
// There are tags with date format (24.08.0), but newer versions are semver
"^(?<major>\\d{2})\\.(?<minor>\\d+)\\.(?<patch>\\d+)$",
["linuxserver/deluge", "linuxserver/diskover"]
),
customVersioning(
// Older versions was 20220101 and newer versions are 240101
"^(?<major>\\d{2})(?<minor>\\d{2})(?<patch>\\d{2})$",
["photoprism/photoprism"]
),
customVersioning(
// RELEASE.2024-08-26T15-33-07Z
"^RELEASE\\.(?<major>\\d+)-(?<minor>\\d+)-(?<patch>\\d+)T\\d+-\\d+-\\d+Z$",
["minio/minio"]
),
customVersioning(
// version-6.0.0
"^version-(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)$",
["fireflyiii/core", "fireflyiii/data-importer"]
),
customVersioning(
// 2024-08-29
"^(?<major>\\d+)-(?<minor>\\d+)-(?<patch>\\d+)$",
["alexta69/metube"]
),
customVersioning(
// 2.462.1-jdk17
"^(?<major>\\d+)\\.(?<minor>\\d+)-jdk17",
["jenkins/jenkins"]
),
],
};

function customVersioning(versioningRegex, packages) {
return {
matchDatasources: ["docker"],
versioning: `regex:${versioningRegex}`,
matchPackageNames: packages,
};
}
2 changes: 2 additions & 0 deletions .github/workflows/renovate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Renovate

on:
workflow_dispatch:
schedule:
- cron: "0 12 * * *"

concurrency:
group: renovate
Expand Down

0 comments on commit 27cef5c

Please sign in to comment.