Added config params github.comments.(commit|pull_request) for allow or deny for PHP Censor to commenting on Github
This commit is contained in:
parent
d77f0e8474
commit
d209482cda
9 changed files with 52 additions and 27 deletions
|
|
@ -211,10 +211,17 @@ class GithubBuild extends RemoteGitBuild
|
|||
$prNumber = $this->getExtra('pull_request_number');
|
||||
$commit = $this->getCommitId();
|
||||
|
||||
$allowCommentCommit = Config::getInstance()->get('php-censor.github.comments.commit');
|
||||
$allowCommentPullRequest = Config::getInstance()->get('php-censor.github.comments.pull_request');
|
||||
|
||||
if (!empty($prNumber)) {
|
||||
$helper->createPullRequestComment($repo, $prNumber, $commit, $file, $diffLineNumber, $message);
|
||||
if ($allowCommentPullRequest) {
|
||||
$helper->createPullRequestComment($repo, $prNumber, $commit, $file, $diffLineNumber, $message);
|
||||
}
|
||||
} else {
|
||||
$helper->createCommitComment($repo, $commit, $file, $diffLineNumber, $message);
|
||||
if ($allowCommentCommit) {
|
||||
$helper->createCommitComment($repo, $commit, $file, $diffLineNumber, $message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue