diff --git a/app/blueprints/github/__init__.py b/app/blueprints/github/__init__.py index 87906189..80e7ff68 100644 --- a/app/blueprints/github/__init__.py +++ b/app/blueprints/github/__init__.py @@ -14,6 +14,8 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +import datetime + from flask import Blueprint, abort from flask_babel import gettext @@ -147,7 +149,7 @@ def webhook(): event = request.headers.get("X-GitHub-Event") if event == "push": ref = json["after"] - title = json["head_commit"]["message"].partition("\n")[0] + title = datetime.datetime.utcnow().strftime("%Y-%m-%d") + " " + ref[:5] branch = json["ref"].replace("refs/heads/", "") if branch not in [ "master", "main" ]: return jsonify({ "success": False, "message": "Webhook ignored, as it's not on the master/main branch" }) diff --git a/app/blueprints/gitlab/__init__.py b/app/blueprints/gitlab/__init__.py index 30edbed9..daf1541a 100644 --- a/app/blueprints/gitlab/__init__.py +++ b/app/blueprints/gitlab/__init__.py @@ -13,6 +13,7 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +import datetime from flask import Blueprint, request, jsonify @@ -53,8 +54,7 @@ def webhook_impl(): event = json["event_name"] if event == "push": ref = json["after"] - title = ref[:5] - + title = datetime.datetime.utcnow().strftime("%Y-%m-%d") + " " + ref[:5] branch = json["ref"].replace("refs/heads/", "") if branch not in ["master", "main"]: return jsonify({"success": False,