2 Commits
v1.0.3 ... v1

Author SHA1 Message Date
Rustem Khusnutdinov
45456c4a56 + 2024-11-29 01:01:59 +03:00
Rustem Khusnutdinov
df86803bc8 + 2024-11-29 00:44:40 +03:00

View File

@@ -17,7 +17,7 @@ import xmltodict
MARKER = """<!-- This comment was produced by coverage-comment-action -->"""
SHIELD_URL = "https://img.shields.io/endpoint?url={url}"
JSON_URL = "https://raw.githubusercontent.com/wiki/{repo_name}/{filename}"
JSON_URL = os.getenv("JSON_URL", "https://raw.githubusercontent.com/wiki/{repo_name}/{filename}")
def main():
@@ -218,14 +218,14 @@ def post_comment(body: str, gh: github.Github, config: Config) -> None:
repo = gh.get_repo(config.GITHUB_REPOSITORY)
assert config.GITHUB_PR_NUMBER
issue = repo.get_issue(config.GITHUB_PR_NUMBER)
for comment in issue.get_comments():
if comment.user.login == me and MARKER in comment.body:
print("Update previous comment")
comment.edit(body=body)
break
else:
print("Adding new comment")
issue.create_comment(body=body)
# for comment in issue.get_comments():
# if comment.user.login == me and MARKER in comment.body:
# print("Update previous comment")
# comment.edit(body=body)
# break
# else:
print("Adding new comment")
issue.create_comment(body=body)
def compute_badge(coverage_info: dict, config: Config) -> str: