From 576567f58603b062f3330d969bb10db573e2b0b1 Mon Sep 17 00:00:00 2001 From: Justin Glommen Date: Mon, 11 Sep 2023 13:47:11 -0700 Subject: [PATCH] fix(infra): Bypass Prerelease Versions from Renovate PRs (#211) * fix(infra): Do not include pulling of prerelease packages [bugfix] * chore(infra): Update snapshot UT to reflect renovate change [bugfix] * chore(infra): Comment for clarify [bugfix] * chore(infra): Include renovate.json5 update [bugfix] * chore(infra): Also include optional 4th set of numerals [bugfix] --- renovate.json5 | 3 ++- src/renovate-workflow.ts | 4 ++++ test/__snapshots__/renovate-workflow.test.ts.snap | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/renovate.json5 b/renovate.json5 index 321db426..bc6ab85e 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -26,7 +26,8 @@ "automerge": true, "addLabels": [ "auto-approve" - ] + ], + "allowedVersions": "!/^[0-9]+\\.[0-9]+\\.[0-9]+(\\.[0-9]+)?-(alpha|beta).*$/" }, { "matchDepTypes": [ diff --git a/src/renovate-workflow.ts b/src/renovate-workflow.ts index e7d0b9ef..bfd96ea8 100644 --- a/src/renovate-workflow.ts +++ b/src/renovate-workflow.ts @@ -124,6 +124,10 @@ export module renovateWorkflow { automerge: options.autoMergeNonBreakingUpdates ? true : undefined, // Adding the auto-approve label will make projens auto approve workflow approve the PR so it will be auto merged addLabels: [options.autoMergeNonBreakingUpdates ? AUTO_APPROVE_PR_LABEL : undefined], + // Bypass prerelease versions: + // https://docs.renovatebot.com/configuration-options/#allowedversions + // Ex: 1.1.1 is allowed, 1.1.1-beta.0 is not allowed. + allowedVersions: '!/^[0-9]+\\.[0-9]+\\.[0-9]+(\\.[0-9]+)?-(alpha|beta).*$/', }, { matchDepTypes: ['optionalDependencies'], diff --git a/test/__snapshots__/renovate-workflow.test.ts.snap b/test/__snapshots__/renovate-workflow.test.ts.snap index 5b61574e..a9cbde33 100644 --- a/test/__snapshots__/renovate-workflow.test.ts.snap +++ b/test/__snapshots__/renovate-workflow.test.ts.snap @@ -114,6 +114,7 @@ exports[`getRenovateOptions defaults 1`] = ` "addLabels": [ undefined, ], + "allowedVersions": "!/^[0-9]+\\.[0-9]+\\.[0-9]+(\\.[0-9]+)?-(alpha|beta).*$/", "automerge": undefined, "groupName": "all non-major dependencies", "groupSlug": "all-minor-patch",