Skip to content

Commit

Permalink
fix: Apply changes after code review
Browse files Browse the repository at this point in the history
Signed-off-by: Oleg Kopysov <o.kopysov@samsung.com>
  • Loading branch information
o-kopysov committed Sep 19, 2024
1 parent f1d1c5c commit ff734eb
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/main/java/com/lpvs/service/LPVSGitHubService.java
Original file line number Diff line number Diff line change
Expand Up @@ -317,17 +317,22 @@ public void commentResults(
}
}

// Generate hub link
String hubLink = "";
if (!StringUtils.isBlank(webhookConfig.getHubLink())) {
hubLink =
"\n\n###### <p align='right'>Check the validation details on the [website]("
+ webhookConfig.getHubLink()
+ ")</p>";
}

if (hasProhibitedOrRestricted || hasConflicts) {
lpvsPullRequest.setStatus(LPVSPullRequestStatus.ISSUES_DETECTED.toString());
pullRequestRepository.save(lpvsPullRequest);
pullRequest.comment(
"**\\[LPVS\\]** Potential license issues detected \n\n"
+ commitComment
+ (!StringUtils.isBlank(webhookConfig.getHubLink())
? ("\n\n###### <p align='right'>Check the validation details on the [website]("
+ webhookConfig.getHubLink()
+ ")</p>")
: ""));
+ hubLink);
repository.createCommitStatus(
webhookConfig.getHeadCommitSHA(),
GHCommitState.FAILURE,
Expand All @@ -338,13 +343,7 @@ public void commentResults(
lpvsPullRequest.setStatus(LPVSPullRequestStatus.COMPLETED.toString());
pullRequestRepository.save(lpvsPullRequest);
pullRequest.comment(
"**\\[LPVS\\]** No license issue detected \n\n"
+ commitComment
+ (!StringUtils.isBlank(webhookConfig.getHubLink())
? ("\n\n###### <p align='right'>Check the validation details on the [website]("
+ webhookConfig.getHubLink()
+ ")</p>")
: ""));
"**\\[LPVS\\]** No license issue detected \n\n" + commitComment + hubLink);
repository.createCommitStatus(
webhookConfig.getHeadCommitSHA(),
GHCommitState.SUCCESS,
Expand Down

0 comments on commit ff734eb

Please sign in to comment.