Skip to content

Commit 20c1f65

Browse files
authored
github: return comment id (#189)
1 parent c360100 commit 20c1f65

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tasks/git/src/main/java/com/walmartlabs/concord/plugins/git/GitHubTask.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,17 +278,17 @@ private Map<String, Object> commentPR(Map<String, Object> in, String gitHubUri)
278278

279279
if (dryRunMode) {
280280
log.info("Dry-run mode enabled: Skipping comment on PR #{} in {}/{}", gitHubPRID, gitHubOrgName, gitHubRepoName);
281-
return Map.of();
281+
return Map.of("id", 0);
282282
}
283283

284284
log.info("Commenting PR #{} in {}/{}", gitHubPRID, gitHubOrgName, gitHubRepoName);
285285

286286
try {
287287
PullRequest pullRequest = prService.getPullRequest(repo, gitHubPRID);
288-
issueService.createComment(repo, Integer.toString(pullRequest.getNumber()), gitHubPRComment);
288+
Comment response = issueService.createComment(repo, Integer.toString(pullRequest.getNumber()), gitHubPRComment);
289289
log.info("Commented on PR# {}", gitHubPRID);
290290

291-
return Collections.emptyMap();
291+
return Map.of("id", response.getId());
292292
} catch (IOException e) {
293293
throw new RuntimeException("Cannot comment on the pull request: " + e.getMessage());
294294
}

0 commit comments

Comments
 (0)