diff --git a/src/main/java/com/rultor/agents/github/qtn/QnMerge.java b/src/main/java/com/rultor/agents/github/qtn/QnMerge.java index 5a585c7c04..85c22e265e 100644 --- a/src/main/java/com/rultor/agents/github/qtn/QnMerge.java +++ b/src/main/java/com/rultor/agents/github/qtn/QnMerge.java @@ -77,25 +77,30 @@ public Req understand(final Comment.Smart comment, issue.repo().coordinates(), issue.number(), comment.number() ); final CheckablePull pull = new CheckablePull(issue.pull()); - if (pull.containsFile(".rultor.yml")) { + final String sysfile = ".rultor.yml"; + if (pull.containsFile(sysfile)) { new Answer(comment).post( - false, - QnMerge.PHRASES - .getString("QnMerge.system-files-affected") + false, + String.format( + QnMerge.PHRASES.getString( + "QnMerge.system-files-affected" + ), + sysfile + ) ); req = Req.DONE; } else if (pull.allChecksSuccessful()) { new Answer(comment).post( - true, - String.format( - QnMerge.PHRASES.getString("QnMerge.start"), - home.toASCIIString() - ) + true, + String.format( + QnMerge.PHRASES.getString("QnMerge.start"), + home.toASCIIString() + ) ); req = QnMerge.pack( - comment, - issue.repo().pulls().get(issue.number()) + comment, + issue.repo().pulls().get(issue.number()) ); } else { new Answer(comment).post( diff --git a/src/main/resources/phrases_en_US.properties b/src/main/resources/phrases_en_US.properties index 5d2589e721..2578b4a206 100644 --- a/src/main/resources/phrases_en_US.properties +++ b/src/main/resources/phrases_en_US.properties @@ -36,8 +36,11 @@ QnMerge.checks-are-failed=Can't merge it. Some CI checks were failed. \ Apparently, the pull request is not ready to be \ merged since it has some problems. \ Please, fix them first. -QnMerge.system-files-affected=Can't merge it. File `.rultor.yml` is affected by \ - this pull request. +QnMerge.system-files-affected=Can't merge this pull requests, because the file \ + `%s` was modified. This is a security threat. \ + Make a separate pull request with the \ + modification of this particular file and ask \ + project architect to merge it manually. QnDeploy.start=OK, I'll try to deploy now. You can check the progress [here](%s) diff --git a/src/test/java/com/rultor/agents/github/qtn/QnMergeTest.java b/src/test/java/com/rultor/agents/github/qtn/QnMergeTest.java index 88787c3edb..1d0729025f 100644 --- a/src/test/java/com/rultor/agents/github/qtn/QnMergeTest.java +++ b/src/test/java/com/rultor/agents/github/qtn/QnMergeTest.java @@ -226,9 +226,9 @@ public void stopsBecauseSystemFilesAffected() MatcherAssert.assertThat( new Comment.Smart(this.comments.get(2)).body(), Matchers.containsString( - QnMergeTest.PHRASES.getString( - "QnMerge.system-files-affected" - ) + QnMergeTest.PHRASES.getString( + "QnMerge.system-files-affected" + ) ) ); }