Skip to content

Commit

Permalink
Add some log to comment_on_pr
Browse files Browse the repository at this point in the history
  • Loading branch information
JackyWoo committed Sep 29, 2024
1 parent bab8418 commit 329ba78
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/github_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
private_key = private_key_part_1 + private_key_part_2

def comment_on_pr(content, title):
print("content:", content)
print(f"content: {content}, title: {title}")
if content is None:
raise Exception("Content is required")

Expand All @@ -68,18 +68,16 @@ def comment_on_pr(content, title):
comments = pull_request.get_issue_comments()

# Check if a comment by raftkeepeer-robot[bot] exists
comment_found = False
for comment in comments:
print("find comment:", comment)
print(f"find comment for {comment.user.login}")
print(f"comment body: {comment.body}")
if comment.user.login == "raftkeepeer-robot[bot]" and title in comment.body:
# Update the existing comment
comment.edit(content)
comment_found = True
break
return

# If not, create a new comment
if not comment_found:
pull_request.create_issue_comment(content)
pull_request.create_issue_comment(content)


def get_artifact_url(artifact_name):
Expand Down

0 comments on commit 329ba78

Please sign in to comment.