From 0765c8e0f8f47f9a163fdaa8b0505447cc4852ce Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 20 Aug 2024 11:40:50 -0700 Subject: [PATCH 1/8] Add validation job to PRs --- .github/workflows/renovate.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/renovate.yml b/.github/workflows/renovate.yml index 94865b8..1832752 100644 --- a/.github/workflows/renovate.yml +++ b/.github/workflows/renovate.yml @@ -28,7 +28,7 @@ env: pr_set: '["bcgov/renovate-config", "bcgov/quickstart-openshift"]' jobs: - Renovate: + run: permissions: pull-requests: write runs-on: ubuntu-22.04 @@ -65,3 +65,11 @@ jobs: with: configurationFile: renovate.json token: ${{ secrets.RENOVATE_TOKEN }} + + validate: + runs-on: ubuntu-22.04 + needs: run-renovate + steps: + - uses: actions/checkout@v4 + - name: Validate Config + run: npx --yes --package renovate --- "renovate-config-validator --strict default.json renovate.json" From b64226ecf8d735c50485c323d39dac7728a0ba73 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 20 Aug 2024 12:56:57 -0700 Subject: [PATCH 2/8] Simplify, limit workflow to only dry run --- .github/workflows/renovate.yml | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/.github/workflows/renovate.yml b/.github/workflows/renovate.yml index 1832752..23d6644 100644 --- a/.github/workflows/renovate.yml +++ b/.github/workflows/renovate.yml @@ -23,39 +23,29 @@ concurrency: group: ${{ github.workflow }} cancel-in-progress: true -# Variables -env: - pr_set: '["bcgov/renovate-config", "bcgov/quickstart-openshift"]' - jobs: run: + env: + pr_set: bcgov/renovate-config bcgov/quickstart-openshift permissions: pull-requests: write runs-on: ubuntu-22.04 steps: - # workflow_dispatch - optional inputs - uses: actions/checkout@v4 - - name: Config for manual workflows (optional) + + # Run Renovate, dry run + - name: Renovate Dry Run run: | - # Process and reformat inputs.repos - IFS=', ' read -a INPUT <<< "${{ inputs.repos }}" + # Process repo list and add to config + IFS=', ' read -a INPUT <<< "${{ inputs.repos || env.pr_set }}" for r in "${INPUT[@]}"; do REPOS+="\"$r\"," done REPOS=${REPOS%,*} - - # Set target repos cat <<< $(jq '. | .repositories = ['${REPOS}']' renovate.json) > renovate.json - cat renovate.json | jq .repositories - # PRs - dry run and a small number of repos - - name: Config for pull requests - if: github.event_name == 'pull_request' - run: | - # Dry run and short repo list + # Dry run cat <<< $(jq '.+= {"dryRun": "full"}' renovate.json) > renovate.json - cat <<< $(jq '. | .repositories = ${{ env.pr_set }}' renovate.json) > renovate.json - cat renovate.json | jq .repositories # Run Renovate - name: Run Renovate From 575c6e7963b467fa46748f6f60cdeede8dca9e56 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 20 Aug 2024 12:58:20 -0700 Subject: [PATCH 3/8] Remove reposiories array from renovate.json --- renovate.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/renovate.json b/renovate.json index 3d34f19..2eeebbd 100644 --- a/renovate.json +++ b/renovate.json @@ -3,6 +3,5 @@ "description": "Default preset for use with Renovate's repos", "extends": [ "github>bcgov/renovate-config" - ], - "repositories": [] + ] } From 2a70e49f4840003fe1b57ac48b8f6f564d5f3ec7 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 20 Aug 2024 13:07:48 -0700 Subject: [PATCH 4/8] Sort JSON alphabetically --- default.json | 72 ++++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/default.json b/default.json index d92700d..43cb607 100644 --- a/default.json +++ b/default.json @@ -1,5 +1,9 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "automerge": true, + "automergeType": "pr", + "configMigration": true, + "dependencyDashboard": true, "description": "Default preset for use with Renovate's repos", "extends": [ "config:recommended", @@ -26,18 +30,31 @@ ":semanticCommitScope(deps)" ], "forkProcessing": "enabled", - "onboarding": true, - "platform": "github", - "configMigration": true, - "dependencyDashboard": true, - "automerge": true, - "automergeType": "pr", - "platformAutomerge": true, - "prCreation": "not-pending", - "rebaseWhen": "behind-base-branch", + "ignorePresets": [ + ":ignoreModulesAndTests" + ], "minimumReleaseAge": "3 days", - "prConcurrentLimit": 5, + "onboarding": true, "packageRules": [ + { + "groupName": "github actions all dependencies", + "groupSlug": "github actions all", + "matchManagers": [ + "github-actions" + ], + "matchUpdateTypes": [ + "major", + "minor", + "patch", + "pin", + "pinDigest", + "digest", + "lockFileMaintenance", + "rollback", + "bump", + "replacement" + ] + }, { "description": "Py - group boto", "groupName": "boto", @@ -132,6 +149,8 @@ ] }, { + "groupName": "maven all non-major dependencies", + "groupSlug": "maven all-minor-patch", "matchManagers": [ "maven" ], @@ -139,28 +158,7 @@ "minor", "patch", "lockFileMaintenance" - ], - "groupName": "maven all non-major dependencies", - "groupSlug": "maven all-minor-patch" - }, - { - "matchManagers": [ - "github-actions" - ], - "matchUpdateTypes": [ - "major", - "minor", - "patch", - "pin", - "pinDigest", - "digest", - "lockFileMaintenance", - "rollback", - "bump", - "replacement" - ], - "groupName": "github actions all dependencies", - "groupSlug": "github actions all" + ] }, { "description": "JS - block eslint9", @@ -174,10 +172,12 @@ ] } ], - "ignorePresets": [ - ":ignoreModulesAndTests" - ], + "platform": "github", + "platformAutomerge": true, + "prConcurrentLimit": 5, + "prCreation": "not-pending", "pre-commit": { "pinDigests": false - } + }, + "rebaseWhen": "behind-base-branch" } From cc6e02db158b630124a5a95b05df289fbdd04738 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 20 Aug 2024 13:20:59 -0700 Subject: [PATCH 5/8] Remove unnecessary options --- default.json | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/default.json b/default.json index 43cb607..522abc1 100644 --- a/default.json +++ b/default.json @@ -1,7 +1,6 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "automerge": true, - "automergeType": "pr", "configMigration": true, "dependencyDashboard": true, "description": "Default preset for use with Renovate's repos", @@ -174,10 +173,5 @@ ], "platform": "github", "platformAutomerge": true, - "prConcurrentLimit": 5, - "prCreation": "not-pending", - "pre-commit": { - "pinDigests": false - }, - "rebaseWhen": "behind-base-branch" + "prConcurrentLimit": 5 } From 30ab1d295afbc856ab80c5097e9a5ba39b105823 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 20 Aug 2024 13:27:29 -0700 Subject: [PATCH 6/8] Improve job names --- .github/workflows/renovate.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/renovate.yml b/.github/workflows/renovate.yml index 23d6644..5acc07a 100644 --- a/.github/workflows/renovate.yml +++ b/.github/workflows/renovate.yml @@ -25,6 +25,7 @@ concurrency: jobs: run: + name: Dry-Run env: pr_set: bcgov/renovate-config bcgov/quickstart-openshift permissions: @@ -34,7 +35,7 @@ jobs: - uses: actions/checkout@v4 # Run Renovate, dry run - - name: Renovate Dry Run + - name: Renovate Dry-Run run: | # Process repo list and add to config IFS=', ' read -a INPUT <<< "${{ inputs.repos || env.pr_set }}" @@ -57,6 +58,7 @@ jobs: token: ${{ secrets.RENOVATE_TOKEN }} validate: + name: Validate runs-on: ubuntu-22.04 needs: run-renovate steps: From 5bc23d7ec540af7007dffb7e1321f845f72191b2 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 20 Aug 2024 13:32:20 -0700 Subject: [PATCH 7/8] Loosen job needs --- .github/workflows/renovate.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/renovate.yml b/.github/workflows/renovate.yml index 5acc07a..4b7b49e 100644 --- a/.github/workflows/renovate.yml +++ b/.github/workflows/renovate.yml @@ -60,7 +60,6 @@ jobs: validate: name: Validate runs-on: ubuntu-22.04 - needs: run-renovate steps: - uses: actions/checkout@v4 - name: Validate Config From f8dcdf5af279223a1249fd1d3af6032b67a1c02d Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 20 Aug 2024 13:56:52 -0700 Subject: [PATCH 8/8] Node version 22 --- .github/workflows/renovate.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/renovate.yml b/.github/workflows/renovate.yml index 4b7b49e..c67822b 100644 --- a/.github/workflows/renovate.yml +++ b/.github/workflows/renovate.yml @@ -62,5 +62,9 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '22' + - name: Validate Config run: npx --yes --package renovate --- "renovate-config-validator --strict default.json renovate.json"