From 4dbab1b9b1fe1385ce9331c8e5445149b4a19198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Smoczy=C5=84ski?= Date: Mon, 12 Apr 2021 12:42:45 +0200 Subject: [PATCH] [EGD-6504] Only current changes in the relnotes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Include only changes from the current changes in the release notes. Signed-off-by: Marcin SmoczyƄski --- print_last_changes.sh | 2 +- tools/last_changelog.awk | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100755 tools/last_changelog.awk diff --git a/print_last_changes.sh b/print_last_changes.sh index 01802978dd0c4586dcd4125f66022e76c10f70aa..1e36d27272092c6f6cd8f8ab5b01ce953bf3d1bc 100755 --- a/print_last_changes.sh +++ b/print_last_changes.sh @@ -7,7 +7,7 @@ CHANGELOG_FILE="changelog.md" function printChangeLogForGH() { - CHANGELOG="$(cat ${CHANGELOG_FILE})" + CHANGELOG="$(awk -f tools/last_changelog.awk ${CHANGELOG_FILE})" CHANGELOG="${CHANGELOG//'%'/'%25'}" CHANGELOG="${CHANGELOG//$'\n'/'%0A'}" CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" diff --git a/tools/last_changelog.awk b/tools/last_changelog.awk new file mode 100755 index 0000000000000000000000000000000000000000..e4616138dabc97e4f2c02f8466580c7d1e28b1ea --- /dev/null +++ b/tools/last_changelog.awk @@ -0,0 +1,17 @@ +#!/usr/bin/awk -f +# Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. +# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md + +BEGIN { + version_count=0 +} + +/^## / { + version_count++ +} + +{ + if(version_count < 2) { + print $0 + } +}