Skip to content

Commit cb3e4a6

Browse files
committed
Leave the previous values for gitlabUserName and gitlabUserEmail
1 parent 6ccd32a commit cb3e4a6

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/main/java/com/dabsquared/gitlabjenkins/trigger/handler/merge/MergeRequestHookTriggerHandlerImpl.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,11 @@ protected CauseData retrieveCauseData(MergeRequestHook hook) {
196196
.withTargetProjectId(hook.getObjectAttributes().getTargetProjectId())
197197
.withBranch(hook.getObjectAttributes().getSourceBranch())
198198
.withSourceBranch(hook.getObjectAttributes().getSourceBranch())
199-
.withUserName(hook.getUser().getName())
199+
.withUserName(
200+
hook.getObjectAttributes().getLastCommit().getAuthor().getName())
200201
.withUserUsername(hook.getUser().getUsername())
201-
.withUserEmail(hook.getUser().getEmail())
202+
.withUserEmail(
203+
hook.getObjectAttributes().getLastCommit().getAuthor().getEmail())
202204
.withSourceRepoHomepage(hook.getObjectAttributes().getSource().getHomepage())
203205
.withSourceRepoName(hook.getObjectAttributes().getSource().getName())
204206
.withSourceNamespace(hook.getObjectAttributes().getSource().getNamespace())

src/main/java/com/dabsquared/gitlabjenkins/trigger/handler/note/NoteHookTriggerHandlerImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ protected CauseData retrieveCauseData(NoteHook hook) {
7171
.withTargetProjectId(hook.getMergeRequest().getTargetProjectId())
7272
.withBranch(hook.getMergeRequest().getSourceBranch())
7373
.withSourceBranch(hook.getMergeRequest().getSourceBranch())
74-
.withUserName(hook.getUser().getName())
74+
.withUserName(hook.getMergeRequest().getLastCommit().getAuthor().getName())
7575
.withUserUsername(hook.getUser().getUsername())
76-
.withUserEmail(hook.getUser().getEmail())
76+
.withUserEmail(
77+
hook.getMergeRequest().getLastCommit().getAuthor().getEmail())
7778
.withSourceRepoHomepage(hook.getMergeRequest().getSource().getHomepage())
7879
.withSourceRepoName(hook.getMergeRequest().getSource().getName())
7980
.withSourceNamespace(hook.getMergeRequest().getSource().getNamespace())

0 commit comments

Comments
 (0)