Skip to content

Commit 843c099

Browse files
fix(gitlab: events): push: fix commit count being off if >20
1 parent 178e6ed commit 843c099

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Gitlab/Events/push.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Push extends EventResponse {
1515

1616
const branch = GetBranchName(data.ref);
1717
const commits = data.commits;
18-
const commitCount = commits.length;
18+
const commitCount = data.total_commits_count;
1919
let pretext = commits
2020
.map((commit) => {
2121
const message = (commitCount === 1 ? commit.message : commit.message.split('\n')[0]).replace(UrlRegEx, RemoveUrlEmbedding);
@@ -40,7 +40,7 @@ class Push extends EventResponse {
4040
const actor = data.user_username || data.user_name;
4141
const branch = GetBranchName(data.ref);
4242
const commits = data.commits || [];
43-
const commitCount = commits.length;
43+
const commitCount = data.total_commits_count;
4444

4545
if (!commitCount) return '';
4646

0 commit comments

Comments
 (0)