diff --git a/src/main/java/com/checkmarx/flow/config/GitHubProperties.java b/src/main/java/com/checkmarx/flow/config/GitHubProperties.java index 201f2f73a..94965345f 100644 --- a/src/main/java/com/checkmarx/flow/config/GitHubProperties.java +++ b/src/main/java/com/checkmarx/flow/config/GitHubProperties.java @@ -39,9 +39,7 @@ public class GitHubProperties extends RepoProperties { @Getter @Setter private Map issueslabel; - @Getter - @Setter - private boolean commentUpdate =true; + public String getMergeNoteUri(String namespace, String repo, String mergeId){ String format = "%s/%s/%s/issues/%s/comments"; diff --git a/src/main/java/com/checkmarx/flow/config/RepoProperties.java b/src/main/java/com/checkmarx/flow/config/RepoProperties.java index 26c009935..c5b40d216 100644 --- a/src/main/java/com/checkmarx/flow/config/RepoProperties.java +++ b/src/main/java/com/checkmarx/flow/config/RepoProperties.java @@ -1,6 +1,8 @@ package com.checkmarx.flow.config; import com.checkmarx.flow.service.PullRequestCommentsHelper; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import javax.annotation.PostConstruct; @@ -30,6 +32,9 @@ public class RepoProperties { private String cxSummaryHeader = "Checkmarx Scan Summary"; private Map optionalInstances; private boolean scanSubmittedComment = true; + @Getter + @Setter + private boolean commentUpdate =true; public Map getOptionalInstances() { return optionalInstances; diff --git a/src/main/java/com/checkmarx/flow/service/RepoService.java b/src/main/java/com/checkmarx/flow/service/RepoService.java index 4dc62a104..70a1e6110 100644 --- a/src/main/java/com/checkmarx/flow/service/RepoService.java +++ b/src/main/java/com/checkmarx/flow/service/RepoService.java @@ -30,9 +30,9 @@ public CxConfig getCxConfigOverride(ScanRequest request) { public void sendMergeComment(ScanRequest request, String comment,boolean commentUpdate){ try { + RepoComment commentToUpdate = + PullRequestCommentsHelper.getCommentToUpdate(getComments(request), comment); if(commentUpdate){ - RepoComment commentToUpdate = - PullRequestCommentsHelper.getCommentToUpdate(getComments(request), comment); if (commentToUpdate != null) { log.debug("Got candidate comment to update. comment: {}", commentToUpdate.getComment()); if (!PullRequestCommentsHelper.shouldUpdateComment(comment, commentToUpdate.getComment())) {