diff --git a/scripts/post-changelog.mjs b/scripts/post-changelog.mjs index db0c51ded3..ff303da5b8 100644 --- a/scripts/post-changelog.mjs +++ b/scripts/post-changelog.mjs @@ -1,14 +1,12 @@ +/* eslint-disable no-console */ import { $, fetch, argv } from 'zx'; import dotenv from 'dotenv-safe'; import slackifyMarkdown from 'slackify-markdown'; import { simpleGit } from 'simple-git'; import gitDiffParser from 'gitdiff-parser'; -/* eslint-disable no-console */ - -const CHANNEL = '#spirit-design-system-notifications_en'; const COLOR_CORE = '#00A58E'; -const PACKAGES = [/* 'web', */ 'web-react' /* 'design-tokens', 'icons', 'codemods', 'analytics' */]; +const PACKAGES = ['web', 'web-react', 'design-tokens', 'icons', 'codemods', 'analytics']; const SLACK_CHANGELOG_WEBHOOK_URL = process.env.SLACK_CHANGELOG_WEBHOOK_URL ?? ''; function getTitle(pkg) { @@ -120,10 +118,7 @@ async function publishChangelog(package_) { await simpleGit().fetch(['origin', 'main', '--tags']); const tags = await simpleGit().tags({ '--sort': '-taggerdate' }); console.log(tags.latest); - const diff = await getDiff( - '@lmc-eu/spirit-web-react@3.0.0-alpha.0' /* tags.latest */ ?? '', - changelogPath(package_), - ); + const diff = await getDiff(tags.latest ?? '', changelogPath(package_)); const files = gitDiffParser.parse(diff); if (files.length === 0) { console.log(`No changes in ${package_}`); @@ -134,7 +129,7 @@ async function publishChangelog(package_) { const formattedChangelog = format(changelog, package_); const slackifiedChangelog = slackifyMarkdown(formattedChangelog); - if (false /* argv.dry */) { + if (argv.dry) { console.info(formattedChangelog); } else { await configureWebhookURL();