From e070ac2f904bfe7aebbdb87a82db9f80536da5d7 Mon Sep 17 00:00:00 2001 From: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com> Date: Sat, 16 Dec 2023 22:00:59 +0100 Subject: [PATCH] Include URL in Discord bot changelog to link to the Github PR page LGTM! --- Tools/actions_changelogs_since_last_run.py | 3 ++- Tools/update_changelog.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Tools/actions_changelogs_since_last_run.py b/Tools/actions_changelogs_since_last_run.py index a2501753a6..4040e9cefc 100755 --- a/Tools/actions_changelogs_since_last_run.py +++ b/Tools/actions_changelogs_since_last_run.py @@ -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(), diff --git a/Tools/update_changelog.py b/Tools/update_changelog.py index b4e661d80d..a42479908b 100755 --- a/Tools/update_changelog.py +++ b/Tools/update_changelog.py @@ -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)