push: filter on branch name;

This commit is contained in:
Benjamin Bouvier 2017-08-30 00:08:16 +02:00
parent 8efdd4544a
commit daeb29868a
2 changed files with 11 additions and 0 deletions

View File

@ -10,6 +10,8 @@ module.exports = {
projectUrl: "https://framagit.org/bnjbvr/kresus/", projectUrl: "https://framagit.org/bnjbvr/kresus/",
branches: ['master'],
// IRC nick/names for the bot // IRC nick/names for the bot
nick: 'gitlab-bot', nick: 'gitlab-bot',
userName: 'gitlab-bot', userName: 'gitlab-bot',

View File

@ -79,6 +79,15 @@ var handlers = {
var numCommits = body.total_commits_count; var numCommits = body.total_commits_count;
var branchName = body.ref.replace('refs/heads/', ''); var branchName = body.ref.replace('refs/heads/', '');
var found = false;
for (var i = 0; i < config.branches.length; i++) {
if (branchName === config.branches[i]) {
found = true;
break;
}
}
if (!found)
return;
var msg = null; var msg = null;
if (!numCommits) { if (!numCommits) {