Skip to content

Commit 9cdc63d

Browse files
committed
Implement review feedback
1 parent a88bf73 commit 9cdc63d

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

AWS/Lambda/CommitEmailer/commit_emailer.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,17 @@ def lambda_handler(event, context):
9898
'pstl': LIBCXX_COMMITS_ADDRESS,
9999
'zorg': LLVM_COMMITS_ADDRESS
100100
}
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+
101112
# Loop through the commits
102113
for commit in event['commits']:
103114
# initialize variables
@@ -175,11 +186,8 @@ def lambda_handler(event, context):
175186
# mail_to = os.environ['MAIL_TO']
176187
mail_to = project_path_email[project]
177188

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
189+
# Everything on a non-personal, non-trunk branches should be
190+
# re-directed to the *branch* commits list
183191
trunk_branches = ['refs/heads/main', 'refs/heads/master']
184192
if not event['ref'] in trunk_branches:
185193
mail_to = LLVM_BRANCH_COMMITS_ADDRESS

0 commit comments

Comments
 (0)