Skip to content

Commit 8c35571

Browse files
committed
[TASK] Update dist
1 parent 403524f commit 8c35571

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

dist/index.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,10 @@ function getCommitMessagesFromPullRequest(accessToken, repositoryOwner, reposito
344344
edges {
345345
node {
346346
commit {
347-
message
347+
message,
348+
parents(last: 1) {
349+
totalCount
350+
}
348351
}
349352
}
350353
}
@@ -369,7 +372,15 @@ function getCommitMessagesFromPullRequest(accessToken, repositoryOwner, reposito
369372
core.debug(` - response: ${JSON.stringify(repository, null, 2)}`);
370373
let messages = [];
371374
if (repository.pullRequest) {
372-
messages = repository.pullRequest.commits.edges.map(function (edge) {
375+
messages = repository.pullRequest.commits.edges
376+
.filter(function (edge) {
377+
if (edge.node.commit.parents.totalCount > 1) {
378+
// Skip merge commits (which have more than 1 parent commit)
379+
return false;
380+
}
381+
return true;
382+
})
383+
.map(function (edge) {
373384
return edge.node.commit.message;
374385
});
375386
}

0 commit comments

Comments
 (0)