Skip to content

Commit 77f200f

Browse files
author
Derek Wasinger
committed
adding lead name and email to commit
1 parent fa6f9a5 commit 77f200f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main/java/com/redhat/labs/omp/service/EngagementService.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ public Project createEngagement(Engagement engagement) {
5959
templateService.processTemplatesForEngagement(templateFiles, engagement);
6060

6161
// create actions for multiple commit
62-
CommitMultiple commit = createCommitMultiple(templateFiles, project.getId(), DEFAULT_BRANCH);
62+
CommitMultiple commit = createCommitMultiple(templateFiles, project.getId(), DEFAULT_BRANCH,
63+
engagement.getEngagementLeadName(), engagement.getEngagementLeadEmail());
6364

6465
// send commit to gitlab
6566
if (!fileService.createFiles(project.getId(), commit)) {
@@ -131,14 +132,16 @@ private Project getOrCreateProject(Integer namespaceId, String projectName, Proj
131132

132133
}
133134

134-
private CommitMultiple createCommitMultiple(List<File> filesToCommit, Integer projectId, String branch) {
135+
private CommitMultiple createCommitMultiple(List<File> filesToCommit, Integer projectId, String branch,
136+
String authorName, String authorEmail) {
135137

136138
List<Action> actions = new ArrayList<>();
137139

138140
// convert each file to action
139141
filesToCommit.parallelStream().forEach(file -> actions.add(createAction(file, FileAction.create)));
140142

141-
return CommitMultiple.builder().id(projectId).branch(branch).commitMessage(COMMIT_MSG).actions(actions).build();
143+
return CommitMultiple.builder().id(projectId).branch(branch).commitMessage(COMMIT_MSG).actions(actions)
144+
.authorName(authorName).authorEmail(authorEmail).build();
142145

143146
}
144147

0 commit comments

Comments
 (0)