Skip to content

Commit

Permalink
fix(gitlab: events): push: fix commit count being off if >20
Browse files Browse the repository at this point in the history
  • Loading branch information
dsevillamartin committed Feb 6, 2022
1 parent 178e6ed commit 843c099
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Gitlab/Events/push.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Push extends EventResponse {

const branch = GetBranchName(data.ref);
const commits = data.commits;
const commitCount = commits.length;
const commitCount = data.total_commits_count;
let pretext = commits
.map((commit) => {
const message = (commitCount === 1 ? commit.message : commit.message.split('\n')[0]).replace(UrlRegEx, RemoveUrlEmbedding);
Expand All @@ -40,7 +40,7 @@ class Push extends EventResponse {
const actor = data.user_username || data.user_name;
const branch = GetBranchName(data.ref);
const commits = data.commits || [];
const commitCount = commits.length;
const commitCount = data.total_commits_count;

if (!commitCount) return '';

Expand Down

0 comments on commit 843c099

Please sign in to comment.