Skip to content

Commit c88954c

Browse files
committed
[TASK] Shorten filter function
1 parent 2f931d9 commit c88954c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/input-helper.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,8 @@ async function getCommitMessagesFromPullRequest(
301301
if (repository.pullRequest) {
302302
messages = repository.pullRequest.commits.edges
303303
.filter(function (edge: CommitEdgeItem): boolean {
304-
if (edge.node.commit.parents.totalCount > 1) {
305-
// Skip merge commits (which have more than 1 parent commit)
306-
return false
307-
}
308-
return true
304+
// Skip merge commits (which have more than 1 parent commit)
305+
return edge.node.commit.parents.totalCount === 1
309306
})
310307
.map(function (edge: CommitEdgeItem): string {
311308
return edge.node.commit.message

0 commit comments

Comments
 (0)