From b22d7af2915bbaccc1d8a8c2c3ff247667f5d61b Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Mon, 3 Apr 2023 13:05:04 -0400 Subject: [PATCH] fix: Add check in release-tool for no relevant PRs (#7478) * fix: Add check in release-tool for no relevant PRs Signed-off-by: Sebastian Malton * fix: Change wording of message while picking PRs Signed-off-by: Sebastian Malton --------- Signed-off-by: Sebastian Malton --- packages/release-tool/src/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/release-tool/src/index.ts b/packages/release-tool/src/index.ts index 9e30cf29a5..d1bc2f9ab7 100755 --- a/packages/release-tool/src/index.ts +++ b/packages/release-tool/src/index.ts @@ -316,6 +316,10 @@ async function cherryPickCommits(prs: ExtendedGithubPrData[]): Promise { } async function pickRelevantPrs(prs: ExtendedGithubPrData[], isMasterBranch: boolean): Promise { + if (prs.length === 0) { + throw new Error("Cannot pick relevant PRs for release if there are none. Are the milestones on github correct?"); + } + if (isMasterBranch) { return prs; } @@ -324,7 +328,7 @@ async function pickRelevantPrs(prs: ExtendedGithubPrData[], isMasterBranch: bool do { selectedPrs = await pickWhichPRsToUse(prs); - } while (selectedPrs.length === 0 && (console.warn("[WARNING]: must pick at least once commit"), true)); + } while (selectedPrs.length === 0 && (console.warn("[WARNING]: must pick at least one commit"), true)); await cherryPickCommits(selectedPrs);