File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,17 @@ def lambda_handler(event, context):
98
98
'pstl' : LIBCXX_COMMITS_ADDRESS ,
99
99
'zorg' : LLVM_COMMITS_ADDRESS
100
100
}
101
+
102
+ # Never send mail about personal branches
103
+ if event ['ref' ].startswith ('refs/heads/users/' ):
104
+ return {
105
+ 'statusCode' : 200 ,
106
+ 'body' : {
107
+ "status" : True ,
108
+ "message" : "Ignoring commit to personal branch"
109
+ }
110
+ }
111
+
101
112
# Loop through the commits
102
113
for commit in event ['commits' ]:
103
114
# initialize variables
@@ -175,8 +186,10 @@ def lambda_handler(event, context):
175
186
# mail_to = os.environ['MAIL_TO']
176
187
mail_to = project_path_email [project ]
177
188
178
- exclude_branches = ['main' , 'master' ]
179
- if not any (x in event ['ref' ] for x in exclude_branches ):
189
+ # Everything on a non-personal, non-trunk branches should be
190
+ # re-directed to the *branch* commits list
191
+ trunk_branches = ['refs/heads/main' , 'refs/heads/master' ]
192
+ if not event ['ref' ] in trunk_branches :
180
193
mail_to = LLVM_BRANCH_COMMITS_ADDRESS
181
194
182
195
# If we're sending an additional email to the same address, break instead
You can’t perform that action at this time.
0 commit comments