From 783b4c2a633101e56e442a3a67b70fcb3a2c8d1c Mon Sep 17 00:00:00 2001 From: Pavol Noha Date: Mon, 4 Nov 2024 11:25:16 -0500 Subject: [PATCH] fix changeset snapshot script --- scripts/changeset-snapshot.mjs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/scripts/changeset-snapshot.mjs b/scripts/changeset-snapshot.mjs index e9c7e584..d169abca 100644 --- a/scripts/changeset-snapshot.mjs +++ b/scripts/changeset-snapshot.mjs @@ -26,16 +26,21 @@ const main = async () => { const commitSha = params['sha']; const output = params['output']; - releasePlan.releases = releasePlan.releases + const releases = releasePlan.releases .filter((r) => r.changesets.length > 0) .map((r) => { - r.newVersion = [ - r.newVersion, - 'pr' + pullRequest, - commitSha.substring(0, 7), - ].join('-'); + return { + ...r, + newVersion: [ + r.newVersion, + 'pr' + pullRequest, + commitSha.substring(0, 7), + ].join('-'), + }; }); + releasePlan.releases = releases; + if (output) { const releaseMessage = getUpgradeMessage(releasePlan); const releaseJson = JSON.stringify(