]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Include URL in Discord bot changelog to link to the Github PR page
authorSlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com>
Sat, 16 Dec 2023 21:00:59 +0000 (22:00 +0100)
committerGitHub <noreply@github.com>
Sat, 16 Dec 2023 21:00:59 +0000 (13:00 -0800)
LGTM!

Tools/actions_changelogs_since_last_run.py
Tools/update_changelog.py

index 0c46cd22ec8ce47e1159724046ad375ca4701492..bdb50bb121ab2481632c042a94e99f1a2035d097 100755 (executable)
@@ -114,8 +114,9 @@ def send_to_discord(entries: Iterable[ChangelogEntry]) -> None:
         for entry in group:
             for change in entry["changes"]:
                 emoji = TYPES_TO_EMOJI.get(change['type'], "❓")
+                url = entry["url"]
                 message = change['message']
-                content.write(f"{emoji} {message}\n")
+                content.write(f"{emoji} [-]({url}) {message}\n")
 
     body = {
         "content": content.getvalue(),
@@ -130,4 +131,4 @@ def send_to_discord(entries: Iterable[ChangelogEntry]) -> None:
     requests.post(DISCORD_WEBHOOK_URL, json=body)
 
 
-main()
\ No newline at end of file
+main()
index b4e661d80d7455ecc3aab1ce73afd5a87c7a559b..a42479908b8e4d25b8d579048c4898baa7f6d679 100755 (executable)
@@ -61,6 +61,7 @@ def main():
             "time", datetime.datetime.now(datetime.timezone.utc).isoformat()
         )
         changes = partyaml["changes"]
+        url = partyaml["url"]
 
         if not isinstance(changes, list):
             changes = [changes]
@@ -71,7 +72,7 @@ def main():
             new_id = max_id
 
             entries_list.append(
-                {"author": author, "time": time, "changes": changes, "id": new_id}
+                {"author": author, "time": time, "changes": changes, "id": new_id, "url": url}
             )
 
         os.remove(partpath)