From f5fc6e38da8b9b52a5f43e26850e7db6a9f1f213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20MARQUET?= Date: Tue, 5 Mar 2024 12:51:15 +0100 Subject: [PATCH] Add date and time of the release (use full when adding a new repo) --- ntfy.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ntfy.py b/ntfy.py index 9377030..34657ff 100644 --- a/ntfy.py +++ b/ntfy.py @@ -84,6 +84,8 @@ def send_to_ntfy(releases, auth, url): version_number = release['tag_name'] # Getting the version number app_url = release['html_url'] # Getting the application URL changelog = release['changelog'] # Getting the changelog + release_date = release['published_at'] # Getting the release date + release_date = release_date.replace("T", " ").replace("Z", "") # Formatting the release date # Checking if the version has changed since the last time cursor.execute("SELECT version FROM versions WHERE repo=?", (app_name,)) @@ -92,7 +94,7 @@ def send_to_ntfy(releases, auth, url): logger.info(f"The version of {app_name} has not changed. No notification sent.") continue # Move on to the next application - message = f"New version: {version_number}\nFor: {app_name}\nChangelog:\n{changelog}\n{app_url}" + message = f"New version: {version_number}\nFor: {app_name}\nPublished on: {release_date}\nChangelog:\n{changelog}\n{app_url}" # Updating the previous version for this application cursor.execute("INSERT OR REPLACE INTO versions (repo, version, changelog) VALUES (?, ?, ?)", (app_name, version_number, changelog))