Skip to content

Commit fdaa739

Browse files
committed
[fix] Return False on true exceptions to avoid masking failures
1 parent a9b28ac commit fdaa739

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

.github/actions/bot-autoassign/issue_assignment_bot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def handle_issue_comment(self):
281281
issue_number = issue.get("number")
282282
if not all([comment_body, commenter, issue_number]):
283283
print("Missing required comment data")
284-
return True
284+
return False
285285
if self.is_assignment_request(comment_body):
286286
return self.respond_to_assignment_request(issue_number, commenter)
287287
print("Comment does not contain assignment request")
@@ -302,7 +302,7 @@ def handle_pull_request(self):
302302
pr_body = pr.get("body", "")
303303
if not all([pr_number, pr_author]):
304304
print("Missing required PR data")
305-
return True
305+
return False
306306
if action in ["opened", "reopened"]:
307307
self.auto_assign_issues_from_pr(pr_number, pr_author, pr_body)
308308
# We consider the event handled even if no issues were linked

.github/actions/bot-autoassign/pr_reopen_bot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def handle_pr_reopen(self):
6969
pr_body = pr.get("body", "")
7070
if not all([pr_number, pr_author]):
7171
print("Missing required PR data")
72-
return True
72+
return False
7373
print(f"Handling PR #{pr_number}" f" reopen by {pr_author}")
7474
reassigned = self.reassign_issues_to_author(pr_number, pr_author, pr_body)
7575
self.remove_stale_label(pr_number)
@@ -110,7 +110,7 @@ def handle_contributor_activity(self):
110110
)
111111
if not all([pr_number, commenter]):
112112
print("Missing required comment data")
113-
return True
113+
return False
114114
if not issue_data.get("pull_request"):
115115
print("Comment is on an issue," " not a PR, skipping")
116116
return True

.github/actions/bot-autoassign/stale_pr_bot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def close_stale_pr(self, pr, days_inactive):
148148
try:
149149
pr_author = pr.user.login if pr.user else None
150150
if not pr_author:
151-
return True
151+
return False
152152
close_lines = [
153153
"<!-- bot:closed -->",
154154
f"Hi @{pr_author} 👋,",
@@ -210,7 +210,7 @@ def mark_pr_stale(self, pr, days_inactive):
210210
try:
211211
pr_author = pr.user.login if pr.user else None
212212
if not pr_author:
213-
return True
213+
return False
214214
unassign_lines = [
215215
"<!-- bot:stale -->",
216216
f"Hi @{pr_author} 👋,",
@@ -273,7 +273,7 @@ def send_stale_warning(self, pr, days_inactive):
273273
try:
274274
pr_author = pr.user.login if pr.user else None
275275
if not pr_author:
276-
return True
276+
return False
277277
remaining = self.DAYS_BEFORE_UNASSIGN - days_inactive
278278
warning_lines = [
279279
"<!-- bot:stale_warning -->",

0 commit comments

Comments
 (0)