Merge pull request #114194 from dims/add-more-validation-for-copy-paste-errors

Add more validation to rules.yaml
This commit is contained in:
Kubernetes Prow Robot 2022-12-10 07:54:10 -08:00 committed by GitHub
commit 9d02dda241
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,6 +81,10 @@ def main():
# And skip validation of publishing rules for it
continue
for item in rule["branches"]:
if not item["source"]["dir"].endswith(rule["destination"]):
raise Exception("copy/paste error `%s` refers to `%s`" % (rule["destination"],item["source"]["dir"]))
if branch["name"] != "master":
raise Exception("cannot find master branch for destination %s" % rule["destination"])
if branch["source"]["branch"] != "master":