diff --git a/.github/renovate.json b/.github/renovate.json5 similarity index 100% rename from .github/renovate.json rename to .github/renovate.json5 diff --git a/.github/workflows/renovate-config-validator.yaml b/.github/workflows/renovate-config-validator.yaml index e4b1c72..ee419e2 100644 --- a/.github/workflows/renovate-config-validator.yaml +++ b/.github/workflows/renovate-config-validator.yaml @@ -1,28 +1,41 @@ -name: Validate Renovate Config +name: "Validate Renovate Config" on: - push + push: jobs: config: strategy: + fail-fast: false matrix: include: - - name: Own Config - config-files: .github/renovate.json + - name: "Own Config" + config-files: .github/renovate.json5 - - name: Shared Config - config-files: default.json # group.json is not possible yet + - name: "Shared Config" + config-files: default.json - name: 🔍 ${{ matrix.name }} + - name: "Shared Config (Actual)" + config-files: default.json5 + + # Not possible yet: "Configuration Error: Invalid configuration option: all". + #- name: "Group Presets" + # config-files: group.json5 + + name: "🔍 ${{ matrix.name }}" + timeout-minutes: 2 + permissions: + # actions/checkout + contents: read runs-on: ubuntu-latest steps: - - name: Checkout ${{ github.ref }} branch in ${{ github.repository }} repository. + - name: "Checkout ${{ github.ref }} branch in ${{ github.repository }} repository." uses: actions/checkout@v4 - - name: Run renovate-config-validator on shared config. + - name: "Run renovate-config-validator on shared config." + shell: bash run: > npx --yes diff --git a/README.md b/README.md index 48afd9d..cf93f28 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,16 @@ Configuration files for renovatebot installed in [repositories](https://github.com/TWiStErRob?tab=repositories). ## Naming -Note: this repository is called `renovate-config` so it'll be [picked up automatically by Renovate](https://docs.renovatebot.com/config-presets/#organization-level-presets). + * This repository is called `renovate-config` so it'll be [picked up automatically by Renovate](https://docs.renovatebot.com/config-presets/#organization-level-presets). + * The shared config preset is called `default.json` as that's the [only supported name](https://docs.renovatebot.com/config-presets/). + * `default.json5` is the actual preset referenced from `default.json`, so that I can use JSON5 features. # Installation 1. Add repository to [Renovate GitHub app installation](https://github.com/settings/installations/24636554). 2. Wait for "Configure Renovate" onboarding PR. 3. It should automatically pick up [local>TWiStErRob/renovate-config](default.json) - 4. Move `/renovate.json` to `/.github/renovate.json`. - 5. Commit and push to `renovate/configure` branch. - 6. Review, configure as necessary and merge PR. + 4. Commit and push to `renovate/configure` branch. + 5. Review, configure as necessary and merge PR. # Development IntelliJ IDEA has json-schema validation and auto-complete support, so it the recommended editor. diff --git a/config.js b/config.js index f9a0139..4cdd021 100644 --- a/config.js +++ b/config.js @@ -1,5 +1,6 @@ const fs = require('fs'); -const configFilePath = "P:\\projects\\workspace\\net.twisterrob.gradle\\.github\\renovate.json"; +const JSON5 = require('json5'); +const configFilePath = "P:\\projects\\contrib\\github-twisterrob-renovate\\.github\\renovate.json5"; const configFileText = fs.readFileSync(configFilePath, "utf8"); module.exports = { // https://docs.renovatebot.com/self-hosted-configuration/#dryrun @@ -27,7 +28,7 @@ module.exports = { // Command line: last parameter in form of user/repo // https://docs.renovatebot.com/self-hosted-configuration/#repositories "repositories": [ - {"repository": "TWiStErRob/net.twisterrob.gradle"}, + { "repository": "TWiStErRob/renovate-config" }, ], // Reduce noise: @@ -54,6 +55,6 @@ module.exports = { // rather than from the loaded JSON. REPORT this sounds like a bug. "force": { // This loads a local file instead. - ...JSON.parse(configFileText) - } + ...JSON5.parse(configFileText), + }, }; diff --git a/default.json b/default.json index 1e53c08..640da8a 100644 --- a/default.json +++ b/default.json @@ -1,65 +1,6 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "onboardingConfigFileName": ".github/renovate.json", "extends": [ - "config:recommended", - ":disableRateLimiting", - "github>TWiStErRob/renovate-config:group/all" - ], - "semanticCommits": "disabled", - "configMigration": true, - "commitMessageExtra": "from {{{currentValue}}} to {{{newValue}}}{{#if isMajor}} (major v{{{newMajor}}}){{else}}{{/if}}", - "labels": ["in:dependencies"], - "separateMajorMinor": true, - "separateMultipleMajor": true, - "separateMinorPatch": true, - "minimumReleaseAge": "8 hours", - "internalChecksFilter": "strict", - "ignorePaths": [ - "do-not-ignore-anything" - ], - "packageRules": [ - { - "description": "Auto-merge all small changes, except for unstable versions.", - "matchUpdateTypes": ["minor", "patch"], - "matchCurrentVersion": "!/^0/", - "automerge": true - }, - { - "description": "Auto-merge all updates of specific dependencies, their 0.x versions are stable and well-controlled.", - "matchUpdateTypes": ["minor", "patch"], - "matchCurrentVersion": "/^0/", - "matchPackageNames": [ - "org.gradle.toolchains.foojay-resolver-convention" - ], - "automerge": true - }, - { - "description": "Auto-merge all digest updates, TODO why?", - "matchUpdateTypes": ["digest"], - "automerge": true - }, - { - "description": "Wait for npm dependencies, they often have small patch releases in quick succession.", - "matchDatasources": ["npm"], - "minimumReleaseAge": "3 days" - }, - { - "description": "Merge my packages as soon as possible.", - "matchPackagePrefixes": ["net.twisterrob"], - "minimumReleaseAge": "0 minutes" - }, - { - "description": "Pin my reusable workflows, semver might not be true.", - "matchDepTypes": ["action"], - "matchPackageNames": [ - "TWiStErRob/github-workflows" - ], - "pinDigests": true - } - ], - "gradle-wrapper": { - "description": "Update Gradle wrapper to non-stable versions", - "ignoreUnstable": false - } + "local>TWiStErRob/renovate-config:default.json5" + ] } diff --git a/default.json5 b/default.json5 new file mode 100644 index 0000000..55c3430 --- /dev/null +++ b/default.json5 @@ -0,0 +1,65 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "onboardingConfigFileName": ".github/renovate.json5", + "extends": [ + "config:recommended", + ":disableRateLimiting", + "local>TWiStErRob/renovate-config:group.json5/all" + ], + "semanticCommits": "disabled", + "configMigration": true, + "commitMessageExtra": "from {{{currentValue}}} to {{{newValue}}}{{#if isMajor}} (major v{{{newMajor}}}){{else}}{{/if}}", + "labels": ["in:dependencies"], + "separateMajorMinor": true, + "separateMultipleMajor": true, + "separateMinorPatch": true, + "minimumReleaseAge": "8 hours", + "internalChecksFilter": "strict", + "ignorePaths": [ + "do-not-ignore-anything" + ], + "packageRules": [ + { + "description": "Auto-merge all small changes, except for unstable versions.", + "matchUpdateTypes": ["minor", "patch"], + "matchCurrentVersion": "!/^0/", + "automerge": true + }, + { + "description": "Auto-merge all updates of specific dependencies, their 0.x versions are stable and well-controlled.", + "matchUpdateTypes": ["minor", "patch"], + "matchCurrentVersion": "/^0/", + "matchPackageNames": [ + "org.gradle.toolchains.foojay-resolver-convention" + ], + "automerge": true + }, + { + "description": "Auto-merge all digest updates, TODO why?", + "matchUpdateTypes": ["digest"], + "automerge": true + }, + { + "description": "Wait for npm dependencies, they often have small patch releases in quick succession.", + "matchDatasources": ["npm"], + "minimumReleaseAge": "3 days" + }, + { + "description": "Merge my packages as soon as possible.", + "matchPackagePrefixes": ["net.twisterrob"], + "minimumReleaseAge": "0 minutes" + }, + { + "description": "Pin my reusable workflows, semver might not be true.", + "matchDepTypes": ["action"], + "matchPackageNames": [ + "TWiStErRob/github-workflows" + ], + "pinDigests": true + } + ], + "gradle-wrapper": { + "description": "Update Gradle wrapper to non-stable versions", + "ignoreUnstable": false + } +} diff --git a/group.json b/group.json5 similarity index 90% rename from group.json rename to group.json5 index d1d65d0..06adb41 100644 --- a/group.json +++ b/group.json5 @@ -4,21 +4,21 @@ "extends": [ "group:monorepos", "group:recommended", - "github>TWiStErRob/renovate-config:group/twisterrob-gradle", - "github>TWiStErRob/renovate-config:group/github-artifacts", - "github>TWiStErRob/renovate-config:group/github-pages", - "github>TWiStErRob/renovate-config:group/kotlin", - "github>TWiStErRob/renovate-config:group/ktor", - "github>TWiStErRob/renovate-config:group/detekt", - "github>TWiStErRob/renovate-config:group/agp", - "github>TWiStErRob/renovate-config:group/agp-lint", - "github>TWiStErRob/renovate-config:group/androidx", - "github>TWiStErRob/renovate-config:group/androidx-test", - "github>TWiStErRob/renovate-config:group/mockito", - "github>TWiStErRob/renovate-config:group/neo4j", - "github>TWiStErRob/renovate-config:group/log4j2", - "github>TWiStErRob/renovate-config:group/jackson", - "github>TWiStErRob/renovate-config:group/notion" + "local>TWiStErRob/renovate-config:group.json5/twisterrob-gradle", + "local>TWiStErRob/renovate-config:group.json5/github-artifacts", + "local>TWiStErRob/renovate-config:group.json5/github-pages", + "local>TWiStErRob/renovate-config:group.json5/kotlin", + "local>TWiStErRob/renovate-config:group.json5/ktor", + "local>TWiStErRob/renovate-config:group.json5/detekt", + "local>TWiStErRob/renovate-config:group.json5/agp", + "local>TWiStErRob/renovate-config:group.json5/agp-lint", + "local>TWiStErRob/renovate-config:group.json5/androidx", + "local>TWiStErRob/renovate-config:group.json5/androidx-test", + "local>TWiStErRob/renovate-config:group.json5/mockito", + "local>TWiStErRob/renovate-config:group.json5/neo4j", + "local>TWiStErRob/renovate-config:group.json5/log4j2", + "local>TWiStErRob/renovate-config:group.json5/jackson", + "local>TWiStErRob/renovate-config:group.json5/notion" ] }, "twisterrob-gradle": { diff --git a/package.json b/package.json index 043838f..239f8d7 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "renovate": "renovate" }, "devDependencies": { + "json5": "2.2.3", "renovate": "37.0.0" }, "jshintConfig": {