From c525a233eeba2af1215816e8f2c597c3461c3dd4 Mon Sep 17 00:00:00 2001 From: Jovi De Croock Date: Sun, 23 Aug 2026 08:02:16 +0200 Subject: [PATCH] fix: update changelog for changesets v3 --- scripts/changelog.js | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/scripts/changelog.js b/scripts/changelog.js index 4ad1d3fc..8428483f 100644 --- a/scripts/changelog.js +++ b/scripts/changelog.js @@ -1,5 +1,5 @@ const { config } = require('dotenv'); -const { getInfo } = require('@changesets/get-github-info'); +const { getCommitInfo } = require('@changesets/get-github-info'); config(); @@ -8,6 +8,15 @@ const SEE_LINE = /^See:\s*(.*)/i; const TRAILING_CHAR = /[.;:]$/g; const listFormatter = new Intl.ListFormat('en-US'); +const getCommitLinks = async commit => { + const info = await getCommitInfo({ repo: REPO, commit }); + return { + commit: info?.commit.markdownLink, + pull: info?.pull?.markdownLink, + user: info?.author?.markdownLink, + }; +}; + const getSummaryLines = cs => { let lines = cs.summary.trim().split(/\r?\n/); if (!lines.some(line => /```/.test(line))) { @@ -49,12 +58,7 @@ const changelogFunctions = { return (match && match[1].trim()) || undefined; } - const { links } = await getInfo({ - repo: REPO, - commit: cs.commit, - }); - - return links; + return getCommitLinks(cs.commit); }) ); @@ -83,14 +87,11 @@ const changelogFunctions = { const [firstLine, ...futureLines] = lines; if (changeset.commit && !pull) { - const { links } = await getInfo({ - repo: REPO, - commit: changeset.commit, - }); - - pull = links.pull || undefined; - commit = links.commit || undefined; - user = links.user || undefined; + const links = await getCommitLinks(changeset.commit); + + pull = links.pull; + commit = links.commit; + user = links.user; } let annotation = '';