Skip to content

Commit 410933e

Browse files
Merge pull request #46 from marcotuna/master
Fix Gitlab webhook commit details
2 parents a6fcb9f + 6760c55 commit 410933e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scm/driver/gitlab/webhook.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,9 @@ func convertPushHook(src *pushHook) *scm.PushHook {
142142
},
143143
}
144144
if len(src.Commits) > 0 {
145-
dst.Commit.Message = src.Commits[0].Message
146-
dst.Commit.Link = src.Commits[0].URL
145+
// get the last commit (most recent)
146+
dst.Commit.Message = src.Commits[len(src.Commits)-1].Message
147+
dst.Commit.Link = src.Commits[len(src.Commits)-1].URL
147148
}
148149
return dst
149150
}

0 commit comments

Comments
 (0)