summaryrefslogtreecommitdiff
path: root/zuul/change_matcher.py
diff options
context:
space:
mode:
authorJan Hruban <jan.hruban@gooddata.com>2016-03-10 21:51:32 +0100
committerJesse Keating <omgjlk@us.ibm.com>2017-05-10 14:32:02 -0700
commit570d01c5fb9aa50529e6e930f8bd9fdf2d9301bf (patch)
tree9cda78844133af41b88e8f6f1ba1238244b57e8f /zuul/change_matcher.py
parent3b415926d21b2015e0391678a004d3071c5e5915 (diff)
downloadzuul-570d01c5fb9aa50529e6e930f8bd9fdf2d9301bf.tar.gz
GitHub file matching support
Allow to configure jobs to run only when certain files are changed. Github does not list the /COMMIT_MSG in the changed files as gerrit does. Therefore the matcher now returns False only if the single file is the /COMMIT_MSG one. Change-Id: I4fa8a328f2ba430c25377e50e1eff7c45829eba6
Diffstat (limited to 'zuul/change_matcher.py')
-rw-r--r--zuul/change_matcher.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/zuul/change_matcher.py b/zuul/change_matcher.py
index 1da1d2c5b..baea21753 100644
--- a/zuul/change_matcher.py
+++ b/zuul/change_matcher.py
@@ -108,7 +108,9 @@ class MatchAllFiles(AbstractMatcherCollection):
yield self.commit_regex
def matches(self, change):
- if not (hasattr(change, 'files') and len(change.files) > 1):
+ if not (hasattr(change, 'files') and change.files):
+ return False
+ if len(change.files) == 1 and self.commit_regex.match(change.files[0]):
return False
for file_ in change.files:
matched_file = False