diff --git a/src/main/java/com/lpvs/service/LPVSGitHubService.java b/src/main/java/com/lpvs/service/LPVSGitHubService.java index eb83e285..4290d310 100644 --- a/src/main/java/com/lpvs/service/LPVSGitHubService.java +++ b/src/main/java/com/lpvs/service/LPVSGitHubService.java @@ -298,9 +298,9 @@ public void commentResults( } } + StringBuilder commitCommentBuilder = new StringBuilder(); if (conflicts != null && conflicts.size() > 0) { hasConflicts = true; - StringBuilder commitCommentBuilder = new StringBuilder(); commitCommentBuilder.append("**Detected license conflicts:**\n\n\n"); commitCommentBuilder.append(""); - if (null != webhookConfig.getHubLink()) { - commitCommentBuilder.append( - "\n\n######

Check the validation details at the link("); - commitCommentBuilder.append(webhookConfig.getHubLink()); - commitCommentBuilder.append(")

"); - } - commitComment += commitCommentBuilder.toString(); } + if (null != webhookConfig.getHubLink()) { + commitCommentBuilder.append( + "\n\n######

Check the validation details at the [link]("); + commitCommentBuilder.append(webhookConfig.getHubLink()); + commitCommentBuilder.append(")

"); + } + commitComment += commitCommentBuilder.toString(); if (hasProhibitedOrRestricted || hasConflicts) { lpvsPullRequest.setStatus(LPVSPullRequestStatus.ISSUES_DETECTED.toString()); diff --git a/src/test/java/com/lpvs/service/LPVSGitHubServiceTest.java b/src/test/java/com/lpvs/service/LPVSGitHubServiceTest.java index 0eb8da14..9975186e 100644 --- a/src/test/java/com/lpvs/service/LPVSGitHubServiceTest.java +++ b/src/test/java/com/lpvs/service/LPVSGitHubServiceTest.java @@ -2179,7 +2179,7 @@ class TestCommentResults__ProhibitedPresentConflictsPresent { + " */\n\n\n\n\n" + "**Detected license conflicts:**\n\n\n" + "" - + "\n\n######

Check the validation details at the link()

"; + + "\n\n######

Check the validation details at the [link]()

"; @BeforeEach void setUp() { @@ -2510,7 +2510,7 @@ class TestCommentResults__EmptyPresentConflictsPresent { + " */\n\n\n\n\n" + "**Detected license conflicts:**\n\n\n" + "" - + "\n\n######

Check the validation details at the link()

"; + + "\n\n######

Check the validation details at the [link]()

"; @BeforeEach void setUp() { @@ -2840,7 +2840,7 @@ class TestCommentResults__UnreviewedPresentConflictsPresent { + " */\n\n\n\n\n" + "**Detected license conflicts:**\n\n\n" + "" - + "\n\n######

Check the validation details at the link()

"; + + "\n\n######

Check the validation details at the [link]()

"; @BeforeEach void setUp() { @@ -3172,7 +3172,7 @@ class TestCommentResults__RestrictedPresentConflictsPresent { + " */\n\n\n\n\n" + "**Detected license conflicts:**\n\n\n" + "" - + "\n\n######

Check the validation details at the link()

"; + + "\n\n######

Check the validation details at the [link]()

"; @BeforeEach void setUp() {