From 928df03b3a30780e89c31789a719b74c7860da81 Mon Sep 17 00:00:00 2001 From: Tomas Psota Date: Tue, 2 Jul 2024 09:21:53 +0200 Subject: [PATCH] ci: update changelog parser --- CHANGELOG.md | 7 +++++-- scripts/extract_changelog.js | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6cac94d..89d839b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,12 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [6.2.1] - 2024-06-19 +## [6.2.1] - 2024-07-02 ### Cordova #### Changed -- CHANGELOG now adheres to the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format. + +- CHANGELOG now adheres to the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format. + +## [6.2.0] - 2024-05-31 # freeRASP 6.2.0 diff --git a/scripts/extract_changelog.js b/scripts/extract_changelog.js index 4572b34..8d11939 100644 --- a/scripts/extract_changelog.js +++ b/scripts/extract_changelog.js @@ -5,8 +5,9 @@ const filePath = './CHANGELOG.md'; const fileContent = fs.readFileSync(filePath, 'utf-8'); const trimmedContent = fileContent - .replace(/\s*#\s*freeRASP.*/, '') // trim the latest version header - .replace(/\s*#\s*freeRASP([\s\S])*/, '') // trim everything after the latest changelog data + .replace(/([\s\S]*?)\s*(?=\s*##)/, '') // trim the # Changelog part + .replace(/\s*##\s*\[\d+\.\d+\.\d+\] - \d{4}-\d{2}-\d{2}.*/, '') // trim the latest version header + .replace(/\s*##\s*\[\d+\.\d+\.\d+\] - \d{4}-\d{2}-\d{2}([\s\S])*/, '') // trim everything after the latest changelog data .trim(); // trim leading and trailing whitespaces console.log(trimmedContent);