Skip to content

Commit a88bf73

Browse files
committed
Fix the commit email filters to exclude personal branches
Fixes: llvm/llvm-project#71185
1 parent a3b0398 commit a88bf73

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

AWS/Lambda/CommitEmailer/commit_emailer.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,13 @@ def lambda_handler(event, context):
175175
# mail_to = os.environ['MAIL_TO']
176176
mail_to = project_path_email[project]
177177

178-
exclude_branches = ['main', 'master']
179-
if not any(x in event['ref'] for x in exclude_branches):
178+
# Never send mail about personal branches
179+
if event['ref'].startswith('refs/heads/users/'):
180+
break
181+
182+
# Everything else on a non-trunk branch should be re-directed to the *branch* commits list
183+
trunk_branches = ['refs/heads/main', 'refs/heads/master']
184+
if not event['ref'] in trunk_branches:
180185
mail_to = LLVM_BRANCH_COMMITS_ADDRESS
181186

182187
# If we're sending an additional email to the same address, break instead

0 commit comments

Comments
 (0)