Last active
November 29, 2024 13:40
-
-
Save mrsarm/1595cf4bce084978ea81875836baac5d to your computer and use it in GitHub Desktop.
Script to run in the developer console from a GitHub Pull Request page to get the list of all commits titles and descriptions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Script to run in the developer console from a GitHub Pull Request page to get the list of all commits titles and descriptions | |
"\n- " + $x('//code/a[@class="Link--secondary markdown-title"]').map(e => { | |
let msg = e.title; | |
const pars = msg.split("\n\n"); | |
if (pars.length > 1) { | |
msg = pars[0] + (pars[0].endsWith(":") || pars[0].endsWith(".") ? "" : ":"); // commit title | |
msg += "\n "; | |
msg += pars[1].split('\n').join('.\n '); // commit description | |
} | |
return msg + (msg.endsWith(".") ? "" : "."); | |
}) | |
.join('\n- ') + "\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The output is formatted in bullet points, with commit titles for each bullet point and ended with a period, and sub paragraphs aligned to the right when there are commit descriptions.
Output looks like: