From 77f606ba73bb5439d66871177772f54196044450 Mon Sep 17 00:00:00 2001 From: Brijesh Bittu Date: Wed, 29 May 2024 17:11:36 +0530 Subject: [PATCH] [docs-infra] Try to parse author login from commit (#42443) --- scripts/releaseChangelog.mjs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/releaseChangelog.mjs b/scripts/releaseChangelog.mjs index 6f8d5c7808c1bb..edc1655b5fc5b5 100644 --- a/scripts/releaseChangelog.mjs +++ b/scripts/releaseChangelog.mjs @@ -111,7 +111,18 @@ async function main(argv) { return chalk.red("TODO INSERT AUTHOR'S USERNAME"); } - return commit.author?.login; + const authorLogin = commit.author.login; + + if (authorLogin === 'github-actions[bot]') { + const authorFromMessage = /\(@(?[a-zA-Z0-9-_]+)\) \(#[\d]+\)/.exec( + commit.commit.message.split('\n')[0], + ); + if (authorFromMessage.groups?.author) { + return authorFromMessage.groups.author; + } + } + + return authorLogin; }; const authors = Array.from(