From 788e68d2b4b0d1f7c45f391b6bcf0f72680386ff Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Thu, 12 May 2022 11:13:28 -0400 Subject: [PATCH] trim some outputs Signed-off-by: Sebastian Malton --- scripts/clear-release-pr.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/clear-release-pr.mjs b/scripts/clear-release-pr.mjs index cda1a17c62..a33049470a 100755 --- a/scripts/clear-release-pr.mjs +++ b/scripts/clear-release-pr.mjs @@ -89,8 +89,8 @@ console.log(`current version: ${currentVersion.format()}`); console.log("fetching tags..."); await execP("git fetch --tags --force"); -const prBase = (await execP("git branch --show-current", { encoding: "utf-8" })).stdout; -const tagListBody = (await execP("git tag --list", { encoding: "utf-8" })).stdout; +const prBase = (await execP("git branch --show-current", { encoding: "utf-8" })).stdout.trim(); +const tagListBody = (await execP("git tag --list", { encoding: "utf-8" })).stdout.trim(); const actualTags = tagListBody.split(/\r?\n/).map(line => line.trim()); const [previousReleasedVersion] = actualTags .map(semverValid) @@ -130,7 +130,7 @@ const getMergedPrsArgs = [ ]; console.log("retreiving last 500 PRs to create release PR body..."); -const mergedPrs = JSON.parse((await execP(getMergedPrsArgs.join(" "), { encoding: "utf-8" })).stdout); +const mergedPrs = JSON.parse((await execP(getMergedPrsArgs.join(" "), { encoding: "utf-8" })).stdout.trim()); const milestoneRelevantPrs = mergedPrs.filter(pr => pr.milestone && pr.milestone.title === currentVersionMilestone); const relaventPrsQuery = await Promise.all( milestoneRelevantPrs.map(async pr => ({