Skip to content

Commit

Permalink
CI Do not post again if CI no longer failing exists (scikit-learn#23768)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjpfan authored Jun 27, 2022
1 parent 72896e2 commit ae7712a
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions maint_tools/update_tracking_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,19 @@ def close_issue_if_opened():
print("Test has no failures!")
issue = get_issue()
if issue is not None:
comment = (
f"## CI is no longer failing! ✅\n\n[Successful run]({args.link_to_ci_run})"
# Comment only if the "## CI is no longer failing" comment does not exist
comment_exists = any(
c.body.startswith("## CI is no longer failing")
for c in issue.get_comments()
)
print(f"Commented on issue #{issue.number}")
issue.create_comment(body=comment)
if not comment_exists:
comment = (
"## CI is no longer failing! ✅\n\n[Successful"
f" run]({args.link_to_ci_run})"
)
print(f"Commented on issue #{issue.number}")
issue.create_comment(body=comment)

if args.auto_close.lower() == "true":
print(f"Closing issue #{issue.number}")
issue.edit(state="closed")
Expand Down

0 comments on commit ae7712a

Please sign in to comment.