From 7bcbb3c0f4f5cdb0d69d5b03064b5cfb8e08bdb0 Mon Sep 17 00:00:00 2001 From: Vanessa Yuen <6842965+vanessayuenn@users.noreply.github.com> Date: Thu, 29 Feb 2024 15:32:43 +0100 Subject: [PATCH 1/2] only use contributors' github handles in release notes --- scripts/release/utils/get-github-info.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/release/utils/get-github-info.ts b/scripts/release/utils/get-github-info.ts index bdfe995a9001..0247e8319e04 100644 --- a/scripts/release/utils/get-github-info.ts +++ b/scripts/release/utils/get-github-info.ts @@ -73,7 +73,7 @@ function makeQuery(repos: ReposWithCommitsAndPRsToFetch) { nodes { name } - } + } mergeCommit { commitUrl oid @@ -255,7 +255,7 @@ export async function getPullInfoFromCommit(request: { pull: associatedPullRequest ? `[#${associatedPullRequest.number}](${associatedPullRequest.url})` : null, - user: user ? `[@${user.login}](${user.url})` : null, + user: user ? `@${user.login}` : null, }, }; } @@ -294,7 +294,7 @@ export async function getPullInfoFromPullRequest(request: { links: { commit: commit ? `[\`${commit.oid}\`](${commit.commitUrl})` : null, pull: `[#${request.pull}](https://github.com/${request.repo}/pull/${request.pull})`, - user: user ? `[@${user.login}](${user.url})` : null, + user: user ? `@${user.login}` : null, }, }; } From 12f5c82b2ef74c094e697c3a771431b17238c5d8 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 5 Mar 2024 12:56:04 +0100 Subject: [PATCH 2/2] use `user` directly from GH PR info instead of links.user --- scripts/release/generate-pr-description.ts | 4 +--- scripts/release/utils/get-changes.ts | 9 ++++----- scripts/release/utils/get-github-info.ts | 4 ++-- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/scripts/release/generate-pr-description.ts b/scripts/release/generate-pr-description.ts index 438c13fb4a91..7b4e397dea2c 100644 --- a/scripts/release/generate-pr-description.ts +++ b/scripts/release/generate-pr-description.ts @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import chalk from 'chalk'; import program from 'commander'; import { z } from 'zod'; @@ -65,7 +64,6 @@ export const mapToChangelist = ({ }): string => { return changes .filter((change) => { - // eslint-disable-next-line no-restricted-syntax for (const titleToIgnore of CHANGE_TITLES_TO_IGNORE) { if (change.title?.match(titleToIgnore)) { return false; @@ -227,7 +225,7 @@ export const generateNonReleaseDescription = ( - Merge this PR - [Follow the run of the publish action](https://github.com/storybookjs/storybook/actions/workflows/publish.yml)` // don't mention contributors in the release PR, to avoid spamming them - .replaceAll('[@', '[@ ') + .replaceAll('@', '') .replaceAll('"', '\\"') .replaceAll('`', '\\`') .replaceAll("'", "\\'") diff --git a/scripts/release/utils/get-changes.ts b/scripts/release/utils/get-changes.ts index 416ea624fb50..8d2811d486db 100644 --- a/scripts/release/utils/get-changes.ts +++ b/scripts/release/utils/get-changes.ts @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import chalk from 'chalk'; import semver from 'semver'; import type { PullRequestInfo } from './get-github-info'; @@ -206,11 +205,11 @@ export const getChangelogText = ({ return entry.labels?.some((label) => Object.keys(RELEASED_LABELS).includes(label)); }) .map((entry) => { - const { title, links } = entry; - const { pull, commit, user } = links; + const { title, user, links } = entry; + const { pull, commit } = links; return pull - ? `- ${title} - ${pull}, thanks ${user}!` - : `- ⚠️ _Direct commit_ ${title} - ${commit} by ${user}`; + ? `- ${title} - ${pull}, thanks @${user}!` + : `- ⚠️ _Direct commit_ ${title} - ${commit} by @${user}`; }) .sort(); const text = [heading, '', ...formattedEntries].join('\n'); diff --git a/scripts/release/utils/get-github-info.ts b/scripts/release/utils/get-github-info.ts index 0247e8319e04..e124026d7133 100644 --- a/scripts/release/utils/get-github-info.ts +++ b/scripts/release/utils/get-github-info.ts @@ -255,7 +255,7 @@ export async function getPullInfoFromCommit(request: { pull: associatedPullRequest ? `[#${associatedPullRequest.number}](${associatedPullRequest.url})` : null, - user: user ? `@${user.login}` : null, + user: user ? `[@${user.login}](${user.url})` : null, }, }; } @@ -294,7 +294,7 @@ export async function getPullInfoFromPullRequest(request: { links: { commit: commit ? `[\`${commit.oid}\`](${commit.commitUrl})` : null, pull: `[#${request.pull}](https://github.com/${request.repo}/pull/${request.pull})`, - user: user ? `@${user.login}` : null, + user: user ? `[@${user.login}](${user.url})` : null, }, }; }