diff --git a/.github/config.js b/.github/config.js new file mode 100644 index 0000000..e9bd3b4 --- /dev/null +++ b/.github/config.js @@ -0,0 +1,41 @@ +module.exports = { + branchPrefix: 'test-renovate/', + username: 'renovate-release', + gitAuthor: 'Renovate Bot ', + platform: 'github', + includeForks: true, + dryRun: 'full', + repositories: ['jessebot/mastodon-helm-chart'], + extends: ['config:base'], + allowPostUpgradeCommandTemplating: true, + allowedPostUpgradeCommands: ['^.*'], + regexManagers: [ + { + fileMatch: ['(^|/)Chart\\.yaml$'], + matchStrings: [ + '#\\s?renovate: image=(?.*?)\\s?appVersion:\\s?\\"?(?[\\w+\\.\\-]*)', + ], + datasourceTemplate: 'docker', + }, + ], + packageRules: [ + { + matchManagers: ['helm-requirements', 'helm-values', 'regex'], + postUpgradeTasks: { + commands: [ + `version=$(grep '^version:' {{{parentDir}}}/Chart.yaml | awk '{print $2}') + major=$(echo $version | cut -d. -f1) + minor=$(echo $version | cut -d. -f2) + patch=$(echo $version | cut -d. -f3) + minor=$(expr $minor + 1) + echo "Replacing $version with $major.$minor.$patch" + sed -i "s/^version:.*/version: $\{major\}.$\{minor\}.$\{patch\}/g" {{{parentDir}}}/Chart.yaml + cat {{{parentDir}}}/Chart.yaml + `, + ], + }, + fileFilters: ['**/Chart.yaml'], + executionMode: 'branch', + }, + ], +}; diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index 2eb070f..0000000 --- a/.github/renovate.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "repositories": [ - "jessebot/mastodon-helm-chart" - ], - "regexManagers": [ - { - "datasourceTemplate": "docker", - "fileMatch": ["(^|/)Chart\\.yaml$"], - "matchStrings": [ - "#\\s?renovate: image=(?.*?)\\s?appVersion:\\s?\\\"?(?[\\w+\\.\\-]*)\"" - ] - } - ] -} diff --git a/.github/workflows/renovate.yaml b/.github/workflows/renovate.yaml index 3f4e153..77ce572 100644 --- a/.github/workflows/renovate.yaml +++ b/.github/workflows/renovate.yaml @@ -14,4 +14,4 @@ jobs: uses: renovatebot/github-action@v39.0.1 with: token: ${{ secrets.RENOVATE_TOKEN }} - configurationFile: .github/renovate.json + configurationFile: .github/config.js