Show release contributors from synced notes

This commit is contained in:
Mohamed Boudra
2026-04-23 09:17:45 +07:00
parent 9c5974735e
commit c8b61f7ddc
2 changed files with 53 additions and 3 deletions
@@ -139,6 +139,19 @@ function updateReleaseNotes({ releaseId, repo, notesPath }, execFileSync = nodeE
);
}
function exposeGitHubContributorMentions(notes) {
return notes.replace(
/\[@([A-Za-z0-9-]+)\]\(https:\/\/github\.com\/([A-Za-z0-9-]+)\/?\)/g,
(match, labelLogin, profileLogin) => {
if (labelLogin.toLowerCase() !== profileLogin.toLowerCase()) {
return match;
}
return `@${profileLogin}`;
},
);
}
export function syncReleaseNotes(argv = process.argv.slice(2), deps = {}) {
const execFileSync = deps.execFileSync ?? nodeExecFileSync;
const args = parseArgs(argv);
@@ -157,6 +170,8 @@ export function syncReleaseNotes(argv = process.argv.slice(2), deps = {}) {
return;
}
notes = exposeGitHubContributorMentions(notes);
const tempDir = mkdtempSync(path.join(tmpdir(), "paseo-release-notes-"));
const notesPath = path.join(tempDir, `${targetTag}-notes.md`);
writeFileSync(notesPath, notes);