1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00

send-to-bot: enrich the comment to update the comment later (#13775)

This commit is contained in:
Sebastiaan Speck 2024-10-01 22:30:10 +02:00 committed by GitHub
parent 5e4d5d2750
commit 2418089208
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,6 +8,7 @@ import requests
BOT_URL = "https://tldr-bot.starbeamrainbowlabs.com" BOT_URL = "https://tldr-bot.starbeamrainbowlabs.com"
COMMENT_ERROR = """ COMMENT_ERROR = """
<!-- tldr-bot - errors -->
The [build](https://github.com/tldr-pages/tldr/actions/runs/{build_id}) for this PR failed with the following error(s): The [build](https://github.com/tldr-pages/tldr/actions/runs/{build_id}) for this PR failed with the following error(s):
``` ```
@ -18,6 +19,7 @@ Please fix the error(s) and push again.
""" """
COMMENT_CHECK = """ COMMENT_CHECK = """
<!-- tldr-bot - check-results -->
Hello! I've noticed something unusual when checking this PR: Hello! I've noticed something unusual when checking this PR:
{content} {content}
@ -29,7 +31,7 @@ Is this intended? If so, just ignore this comment. Otherwise, please double-chec
def post_comment(pr_id, body): def post_comment(pr_id, body):
endpoint = f"{BOT_URL}/comment" endpoint = f"{BOT_URL}/comment/recreate"
data = {"pr_id": pr_id, "body": body} data = {"pr_id": pr_id, "body": body}