Skip to content

Commit 9a65cd4

Browse files
Handle no change case
When there is no change to the issue tracker, the action should not post any new issue. Let's add a check before posting any comments to the server.
1 parent 4aebafb commit 9a65cd4

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

digest_manager.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,16 @@ def convert_data(self, graphqlResult: dict, ret: dict[str, GitIssue]):
7878
ret[issue.id] = issue
7979

8080
def send_data(self, issues: list[GitIssue]):
81+
total_changes = sum([issue.total_changes for issue in issues])
82+
if total_changes == 0:
83+
# no changes were detected
84+
return
85+
8186
r1 = UpdateIssue("update_issue").partial_query(self.target_issue, digest_content)
8287
r2 = AddComment("new_digest").partial_query(self.target_issue, digest_header.format(
8388
time_start=helper.format_local(self.last_update_time),
8489
time_end=helper.format_local(helper.get_now()),
85-
all_changes=sum([issue.total_changes for issue in issues]),
90+
all_changes=total_changes,
8691
issues_changed=len(issues),
8792
body='\n'.join([issue.to_markdown() for issue in issues])
8893
))

0 commit comments

Comments
 (0)