Skip to content

Commit

Permalink
Update the changelog script to support prs that are squashed via gith…
Browse files Browse the repository at this point in the history
…ub UI (#4779)
  • Loading branch information
bmac authored and stefanpenner committed Feb 28, 2017
1 parent 20f6ae3 commit 33d2b4d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bin/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,23 @@ function getCommitMessage(commitInfo) {
function processPages(res) {
var contributions = res.commits.filter(function(commitInfo) {
var message = commitInfo.commit.message;

return message.indexOf('Merge pull request #') > -1 || message.indexOf('cherry picked from') > -1;
return message.indexOf('Merge pull request #') > -1 || message.indexOf('cherry picked from') > -1 || message.match(/\(#\d+\)\n/)
}).map(function(commitInfo) {
var message = getCommitMessage(commitInfo);
var match = message.match(/#(\d+) from (.*)\//);
var squashMatch = message.match(/#(\d+)\)\n/)
var result = {
sha: commitInfo.sha
};

if (match) {
var numAndAuthor = match.slice(1, 3);

result.number =numAndAuthor[0];
result.number = numAndAuthor[0];
result.title = message.split('\n\n')[1];
} else if (squashMatch) {
result.number = squashMatch[1];
result.title = message.split('\n\n')[0];
} else {
result.title = message.split('\n\n')[0];
}
Expand Down

0 comments on commit 33d2b4d

Please sign in to comment.