Skip to content

Commit 77f606b

Browse files
authored
[docs-infra] Try to parse author login from commit (#42443)
1 parent 4a1101b commit 77f606b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

scripts/releaseChangelog.mjs

+12-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,18 @@ async function main(argv) {
111111
return chalk.red("TODO INSERT AUTHOR'S USERNAME");
112112
}
113113

114-
return commit.author?.login;
114+
const authorLogin = commit.author.login;
115+
116+
if (authorLogin === 'github-actions[bot]') {
117+
const authorFromMessage = /\(@(?<author>[a-zA-Z0-9-_]+)\) \(#[\d]+\)/.exec(
118+
commit.commit.message.split('\n')[0],
119+
);
120+
if (authorFromMessage.groups?.author) {
121+
return authorFromMessage.groups.author;
122+
}
123+
}
124+
125+
return authorLogin;
115126
};
116127

117128
const authors = Array.from(

0 commit comments

Comments
 (0)