Show release contributors from synced notes
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user