From 6abddc3477ed69c08f0114d49f2c67f722a05696 Mon Sep 17 00:00:00 2001 From: maxnorm Date: Wed, 1 Apr 2026 15:33:02 -0400 Subject: [PATCH] mention contributors in generated release note --- .github/scripts/release-notes.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/scripts/release-notes.js b/.github/scripts/release-notes.js index 76e146a0..9d31cf02 100644 --- a/.github/scripts/release-notes.js +++ b/.github/scripts/release-notes.js @@ -5,6 +5,8 @@ * - pr: merged PRs linked to commits in range, filtered by changed files vs releaseNotesPaths * - commits: path-filtered git log (escape hatch) * + * PR lines: title by @author in #N (PR opener). @mentions power GitHub’s release avatar strip. + * * Usage: * node release-notes.js [mode] * Env: GITHUB_REPOSITORY=owner/name, RELEASE_NOTES_MODE, GH_TOKEN or GITHUB_TOKEN @@ -148,6 +150,11 @@ function renderCommitMode(paths, prev, tag) { return `## Changes (paths: ${paths.join(', ')})\n\n${body}\n`; } +function formatPrLine(p) { + const by = p.author_login ? ` by @${p.author_login}` : ''; + return `- ${p.title}${by} in [#${p.number}](${p.html_url})`; +} + async function renderPrMode(tag, tagPrefix, paths) { const { owner, repo } = parseRepo(); const tags = listTagsForPrefix(tagPrefix); @@ -180,6 +187,10 @@ async function renderPrMode(tag, tagPrefix, paths) { continue; } const detail = await ghApiJson(`repos/${owner}/${repo}/pulls/${num}`); + const authorLogin = + detail.user && typeof detail.user.login === 'string' + ? detail.user.login + : null; included.push({ number: num, title: detail.title || `PR #${num}`, @@ -187,6 +198,7 @@ async function renderPrMode(tag, tagPrefix, paths) { detail.html_url || `https://github.com/${owner}/${repo}/pull/${num}`, merged_at: detail.merged_at || null, + author_login: authorLogin, }); } @@ -197,9 +209,7 @@ async function renderPrMode(tag, tagPrefix, paths) { return b.number - a.number; }); - const lines = included.map( - p => `- ${p.title} ([#${p.number}](${p.html_url}))`, - ); + const lines = included.map(formatPrLine); const orphanLines = []; for (let i = 0; i < shas.length; i += 1) { @@ -224,6 +234,8 @@ async function renderPrMode(tag, tagPrefix, paths) { md += `\n### Other commits (no linked PR)\n\n${orphanLines.join('\n')}\n`; } + md += "### Thank you to all the contributors who helped make this release.\n\n"; + return md; }