Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
45456c4a56 | ||
|
|
df86803bc8 |
@@ -17,7 +17,7 @@ import xmltodict
|
|||||||
|
|
||||||
MARKER = """<!-- This comment was produced by coverage-comment-action -->"""
|
MARKER = """<!-- This comment was produced by coverage-comment-action -->"""
|
||||||
SHIELD_URL = "https://img.shields.io/endpoint?url={url}"
|
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():
|
def main():
|
||||||
@@ -218,14 +218,14 @@ def post_comment(body: str, gh: github.Github, config: Config) -> None:
|
|||||||
repo = gh.get_repo(config.GITHUB_REPOSITORY)
|
repo = gh.get_repo(config.GITHUB_REPOSITORY)
|
||||||
assert config.GITHUB_PR_NUMBER
|
assert config.GITHUB_PR_NUMBER
|
||||||
issue = repo.get_issue(config.GITHUB_PR_NUMBER)
|
issue = repo.get_issue(config.GITHUB_PR_NUMBER)
|
||||||
for comment in issue.get_comments():
|
# for comment in issue.get_comments():
|
||||||
if comment.user.login == me and MARKER in comment.body:
|
# if comment.user.login == me and MARKER in comment.body:
|
||||||
print("Update previous comment")
|
# print("Update previous comment")
|
||||||
comment.edit(body=body)
|
# comment.edit(body=body)
|
||||||
break
|
# break
|
||||||
else:
|
# else:
|
||||||
print("Adding new comment")
|
print("Adding new comment")
|
||||||
issue.create_comment(body=body)
|
issue.create_comment(body=body)
|
||||||
|
|
||||||
|
|
||||||
def compute_badge(coverage_info: dict, config: Config) -> str:
|
def compute_badge(coverage_info: dict, config: Config) -> str:
|
||||||
|
|||||||
Reference in New Issue
Block a user