Skip to content

Commit c411875

Browse files
author
Ilya Radchenko
committed
Merge pull request #64 from Voffkaa/avoidPullRequestDeploy
Permit deploy to commits only
2 parents 3e7d918 + 1728477 commit c411875

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/webhooks.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,19 @@ function makeJob(project, config) {
2020
var branch;
2121
var job;
2222

23-
branch = project.branch(config.branch) || {active: true, mirror_master: true, deploy_on_green: false};
23+
branch = project.branch(config.branch) || {active: true, mirror_master: true, deploy_on_green: false, deploy_on_pull_request: false};
2424
if (!branch.active) return false;
2525
if (config.branch !== 'master' && branch.mirror_master) {
2626
// mirror_master branches don't deploy
2727
deploy = false
2828
} else {
2929
deploy = config.deploy && branch.deploy_on_green
3030
}
31+
32+
if(config.trigger.type === 'pull-request') {
33+
deploy = (branch.deploy_on_pull_request === true)
34+
}
35+
3136
job = {
3237
type: deploy ? 'TEST_AND_DEPLOY' : 'TEST_ONLY',
3338
trigger: config.trigger,

0 commit comments

Comments
 (0)