File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -237,7 +237,17 @@ def validate_commit(commit):
237237 # or if it's an umbrella prefix that doesn't match.
238238 if len (non_build_prefixes ) > 1 :
239239 # Only umbrella prefixes are allowed to cover multiple components
240- if subj_lower not in umbrella_prefixes :
240+ if subj_lower in umbrella_prefixes :
241+ # Ensure all changed paths are within the umbrella domain
242+ norm_paths = [p .replace (os .sep , "/" ) for p in files ]
243+ if not all (p .startswith ("lib/" ) for p in norm_paths ):
244+ expected_list = sorted (expected )
245+ expected_str = ", " .join (expected_list )
246+ return False , (
247+ f"Subject prefix '{ subject_prefix } ' does not match files changed.\n "
248+ f"Expected one of: { expected_str } "
249+ )
250+ elif subj_lower not in umbrella_prefixes :
241251 expected_list = sorted (expected )
242252 expected_str = ", " .join (expected_list )
243253 return False , (
You can’t perform that action at this time.
0 commit comments