From 7b928262ece639082e21ab09a5d732e04f617470 Mon Sep 17 00:00:00 2001 From: Sarka Chwastkova Date: Thu, 16 Jan 2025 14:52:39 +0100 Subject: [PATCH] chore: add Playroom link to Slack changelog message --- scripts/post-changelog.mjs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/post-changelog.mjs b/scripts/post-changelog.mjs index 24eb988171..776ccdf2cf 100644 --- a/scripts/post-changelog.mjs +++ b/scripts/post-changelog.mjs @@ -102,13 +102,22 @@ async function publishChangelog(package_) { const tags = await simpleGit().tags({ "--sort": "-taggerdate" }); const diff = await getDiff(tags.latest ?? "", changelogPath(package_)); const files = gitDiffParser.parse(diff); + let playroomLink; + if (files.length === 0) { console.log(`No changes in ${package_}`); return; } + + if (package_ === "orbit-components") { + const latestTag = tags.all.find(tag => tag.includes("@kiwicom/orbit-components@")); + const releaseVersion = latestTag.split("@").pop().replace(".", "-"); + playroomLink = `**Playroom for ${releaseVersion} is available [here](https://kiwicom-orbit-v${releaseVersion}.surge.sh)** 🕹️ \n` + } + const changelog = getChangelogFromDiff(files); const formattedChangelog = format(changelog, package_); - const slackifiedChangelog = slackifyMarkdown(formattedChangelog); + const slackifiedChangelog = slackifyMarkdown(playroomLink || '' + formattedChangelog); if (argv.dry) { console.info(formattedChangelog);