File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -101,11 +101,19 @@ def close_issue_if_opened():
101
101
print ("Test has no failures!" )
102
102
issue = get_issue ()
103
103
if issue is not None :
104
- comment = (
105
- f"## CI is no longer failing! ✅\n \n [Successful run]({ args .link_to_ci_run } )"
104
+ # Comment only if the "## CI is no longer failing" comment does not exist
105
+ comment_exists = any (
106
+ c .body .startswith ("## CI is no longer failing" )
107
+ for c in issue .get_comments ()
106
108
)
107
- print (f"Commented on issue #{ issue .number } " )
108
- issue .create_comment (body = comment )
109
+ if not comment_exists :
110
+ comment = (
111
+ "## CI is no longer failing! ✅\n \n [Successful"
112
+ f" run]({ args .link_to_ci_run } )"
113
+ )
114
+ print (f"Commented on issue #{ issue .number } " )
115
+ issue .create_comment (body = comment )
116
+
109
117
if args .auto_close .lower () == "true" :
110
118
print (f"Closing issue #{ issue .number } " )
111
119
issue .edit (state = "closed" )
You can’t perform that action at this time.
0 commit comments