Skip to content

Instantly share code, notes, and snippets.

@mrsarm
Last active November 29, 2024 13:40
Show Gist options
  • Save mrsarm/1595cf4bce084978ea81875836baac5d to your computer and use it in GitHub Desktop.
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
// 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"
@mrsarm
Copy link
Author

mrsarm commented Nov 29, 2024

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:

- Better handling of errors.
- Retry PUT submission 404 errors:
  Read-only DB may not replicate records soon enough when website tries to fetch them.
- Merge pull request #961 from fix/another-problem:
  Another problem solved from another PR merged in here.
- Keys: more emails and tags validations:
  - Max emails and tags allowed is 20.
  - Tags cannot be more than 40 chars long.
  - Tags accept letters, numbers, space, period, underscore and hyphen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment