clear-pr-merge-commit-message - Clear redundant co-authors#9340
Conversation
fregante
left a comment
There was a problem hiding this comment.
Looks good! I just have some nits
clear-pr-merge-commit-message - Clear redundant coauthor messages by PR authors at merge timeclear-pr-merge-commit-message - Clear redundant co-authors
Co-Authored-By: fregante <me@fregante.com>
|
I hope this aligns better with what you had in mind – thanks for the suggestions! |
Co-Authored-By: Grigory <techuila.sunset@gmail.com>
|
I don't understand why we need the export function getConversationAuthor(): string | undefined {
const body = $optional(['.react-issue-body', '.js-command-palette-pull-body']);
return body ? getCommentAuthor(body) : undefined;
} |
Co-Authored-By: Grigory <techuila.sunset@gmail.com>
There are probably other features that can (and should) use this function. Since getCommentAuthor specifically expects one comment, the question would be why would you not pass one comment? |
Co-Authored-By: Grigory <techuila.sunset@gmail.com>
|
Let's at least rename |
|
Agreed! |
Co-Authored-By: Grigory <techuila.sunset@gmail.com>
|
This doesn't work with bots due to a bug in |
|
Thanks, good catch! I couldn't have caught it with my own PR. For my curiosity: what is changing in October 2026? |
Six months will pass. I don't know when those links became relative, so it's safest to assume it happened just now. For users on older GitHub Enterprise versions, they are still absolute. We support GHE versions that are no older than six months |
|
After writing this, I realized that links to public GitHub apps should probably always be absolute on GHE |
|
Thanks to you both for making my recent contributions a pleasurable experience! I appreciate it a lot! |

This PR is a follow-up to #9336 as discussed in #9336 (comment) with @fregante. The idea is that if a PR author creates a PR, the author's own "Co-authored-by" commit messages added to the commit description at squash-merge time are redundant and can be removed. This also applies to bots, such as Dependabot, Renovate, pre-commit-ci, github-actions, and so on. In this case, we can remove them, as they also use private/noreply email addresses.
I've slightly adjusted the logic for
getConversationAuthor, because the previous version wasn't working for me. Suggestions are welcome, thanks!Test URLs
I tested this in a PR on my profile repository at agriyakhetarpal/agriyakhetarpal#1.
Screenshot
Here is a video:
Screen.Recording.2026-05-04.at.17.54.26.mov
As it can be seen,
Co-authored-by: 74401230+agriyakhetarpal@users.noreply.github.comwas cleared and is absent.example(I added them as a co-author on commit five)'s co-author message is preserved. For users with accounts before July 18, 2017, their privacy emails are of a different kind and are preserved (commit seven). For the bot case, i.e.,github-actions[bot], its co-author message is preserved as well. Lastly, commit sign-offs are treated as separate from co-authoring and are thus preserved, too.Thank you :)