Skip to content

Commit

Permalink
chore: add Playroom link to Slack changelog message
Browse files Browse the repository at this point in the history
  • Loading branch information
sarkaaa committed Jan 16, 2025
1 parent f19a675 commit 7b92826
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion scripts/post-changelog.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7b92826

Please sign in to comment.