From 2b71a6c4f4a10bc4b5b0733b627a161de7e14bc1 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 6 Apr 2023 11:10:42 +0100 Subject: [PATCH 1/2] Add tiny release notes script --- scripts/reformat-release-notes.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 scripts/reformat-release-notes.py diff --git a/scripts/reformat-release-notes.py b/scripts/reformat-release-notes.py new file mode 100755 index 00000000..f8ad1824 --- /dev/null +++ b/scripts/reformat-release-notes.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 + +# This script can be used to reformat the release notes generated by +# GitHub releases into a format slightly more appropriate for our +# project (ie. we don't really need to mention the author of every PR) +# +# eg. in: * OpenTelemetry by @dbkr in https://github.com/vector-im/element-call/pull/961 +# out: * OpenTelemetry (https://github.com/vector-im/element-call/pull/961) + +import sys +import re + +for line in sys.stdin: + matches = re.match(r'^\* (.*) by (.*) in (.*)$', line.strip()) + print("* %s (%s)" % (matches[1], matches[3])) From 480e46c5b2277ed57e560f34bfbeb059334359c5 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 6 Apr 2023 17:59:48 +0100 Subject: [PATCH 2/2] Fix my lazy regexing Co-authored-by: Robin --- scripts/reformat-release-notes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/reformat-release-notes.py b/scripts/reformat-release-notes.py index f8ad1824..ad216ff4 100755 --- a/scripts/reformat-release-notes.py +++ b/scripts/reformat-release-notes.py @@ -11,5 +11,5 @@ import sys import re for line in sys.stdin: - matches = re.match(r'^\* (.*) by (.*) in (.*)$', line.strip()) + matches = re.match(r'^\* (.*) by (\S+) in (\S+)$', line.strip()) print("* %s (%s)" % (matches[1], matches[3]))