From 3441703df3ee15e388fe189f2238da1d15f3e909 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20M=C3=BCller?= Date: Sat, 27 Aug 2016 17:42:19 +0200 Subject: [PATCH] Use author of the last commit for "pushed by" description --- CHANGELOG.md | 1 + .../trigger/handler/push/PushHookTriggerHandlerImpl.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38bb2ee..e5d5521 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ChangeLog * #69: Link to gitlab merge request url in getShortDescription posted to jenkins * #396: Jenkins job stuck publishing build status * #400: Fix gitlabBuilds step to actually use 'pending' +* JENKINS-35258: ci-skip and author should use the latest commit, not the first one from the push event 1.3.0 ===================== diff --git a/src/main/java/com/dabsquared/gitlabjenkins/trigger/handler/push/PushHookTriggerHandlerImpl.java b/src/main/java/com/dabsquared/gitlabjenkins/trigger/handler/push/PushHookTriggerHandlerImpl.java index 2dbaf54..67d06fc 100644 --- a/src/main/java/com/dabsquared/gitlabjenkins/trigger/handler/push/PushHookTriggerHandlerImpl.java +++ b/src/main/java/com/dabsquared/gitlabjenkins/trigger/handler/push/PushHookTriggerHandlerImpl.java @@ -104,7 +104,7 @@ class PushHookTriggerHandlerImpl extends AbstractWebHookTriggerHandler final List commits = hook.getCommits(); if (commits != null && !commits.isEmpty()) { - return commits.get(0).getAuthor().getName(); + return commits.get(commits.size() - 1).getAuthor().getName(); } return null;