diff --git a/github-pullrequest-plugin/src/main/java/com/github/kostyasha/github/integration/branch/events/impl/commitchecks/impl/GitHubBranchCommitMessageCheck.java b/github-pullrequest-plugin/src/main/java/com/github/kostyasha/github/integration/branch/events/impl/commitchecks/impl/GitHubBranchCommitMessageCheck.java index f8b29c67..a159c51c 100644 --- a/github-pullrequest-plugin/src/main/java/com/github/kostyasha/github/integration/branch/events/impl/commitchecks/impl/GitHubBranchCommitMessageCheck.java +++ b/github-pullrequest-plugin/src/main/java/com/github/kostyasha/github/integration/branch/events/impl/commitchecks/impl/GitHubBranchCommitMessageCheck.java @@ -85,7 +85,7 @@ private GitHubBranchCause check(GHBranch remoteBranch, GitHubBranchRepositor List messages = supplier.get(); if (commitsAreAllowed(messages)) { LOG.debug("Commit messages {} for branch [{}] allowed, commit ignored.", messages, name); - return null; + return toCause(remoteBranch, localRepo, false, "Commit messages %s for branch [%s] allowed by check.", messages, name); } return toCause(remoteBranch, localRepo, true, "Commit messages %s for branch [%s] not allowed by check.", messages, name); diff --git a/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/branch/events/impl/GitHubBranchCommitEvent/config.groovy b/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/branch/events/impl/GitHubBranchCommitEvent/config.groovy index 48e892cf..af41e18d 100644 --- a/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/branch/events/impl/GitHubBranchCommitEvent/config.groovy +++ b/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/branch/events/impl/GitHubBranchCommitEvent/config.groovy @@ -10,13 +10,11 @@ if (instance == null) { } f.block { - table(style: 'width:100%; margin-left: 5px;') { - f.entry() { - f.hetero_list(name: "checks", - items: instance.checks, - descriptors: descriptor.getEventDescriptors(), - hasHeader: true - ) - } + f.entry() { + f.hetero_list(name: "checks", + items: instance.checks, + descriptors: descriptor.getEventDescriptors(), + hasHeader: true + ) } } diff --git a/github-pullrequest-plugin/src/test/java/com/github/kostyasha/github/integration/branch/events/impl/commitchecks/impl/GitHubBranchCommitMessageCheckTest.java b/github-pullrequest-plugin/src/test/java/com/github/kostyasha/github/integration/branch/events/impl/commitchecks/impl/GitHubBranchCommitMessageCheckTest.java index 6b0de6cd..a4879c17 100644 --- a/github-pullrequest-plugin/src/test/java/com/github/kostyasha/github/integration/branch/events/impl/commitchecks/impl/GitHubBranchCommitMessageCheckTest.java +++ b/github-pullrequest-plugin/src/test/java/com/github/kostyasha/github/integration/branch/events/impl/commitchecks/impl/GitHubBranchCommitMessageCheckTest.java @@ -69,7 +69,7 @@ public void testComparedCommitsReturnNoCause() { givenCommitMessages(); givenAMessagePattern(); whenComparedCommitsAreChecked(); - thenCheckHasNoEffect(); + thenBuildIsNotSkipped(); } @Test @@ -77,7 +77,7 @@ public void testLastCommitReturnNoCause() throws Exception { givenACommitMessage(); givenAMessagePattern(); whenLastCommitIsChecked(); - thenCheckHasNoEffect(); + thenBuildIsNotSkipped(); } @Test @@ -119,7 +119,11 @@ private void givenMessageShouldBeExcluded() { } private void thenBuildIsSkipped() { - assertThat("build triggered", result.isSkip(), equalTo(true)); + assertThat("build not triggered", result.isSkip(), equalTo(true)); + } + + private void thenBuildIsNotSkipped() { + assertThat("build triggered", result.isSkip(), equalTo(false)); } private void thenCheckHasNoEffect() {