Skip to content

Commit 507cf18

Browse files
committed
ci: update changelog parser
1 parent 67fd521 commit 507cf18

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
#### Changed
1313
- CHANGELOG now adheres to the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format.
1414

15+
## [3.8.0] - 2024-05-31
1516

1617
# freeRASP 3.8.0
1718

scripts/extract_changelog.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ const filePath = './CHANGELOG.md';
55
const fileContent = fs.readFileSync(filePath, 'utf-8');
66

77
const trimmedContent = fileContent
8-
.replace(/\s*#\s*freeRASP.*/, '') // trim the latest version header
9-
.replace(/\s*#\s*freeRASP([\s\S])*/, '') // trim everything after the latest changelog data
8+
.replace(/([\s\S]*?)\s*(?=\s*##)/, '') // trim the # Changelog part
9+
.replace(/\s*##\s*\[\d+\.\d+\.\d+\] - \d{4}-\d{2}-\d{2}.*/, '') // trim the latest version header
10+
.replace(/\s*##\s*\[\d+\.\d+\.\d+\] - \d{4}-\d{2}-\d{2}([\s\S])*/, '') // trim everything after the latest changelog data
1011
.trim(); // trim leading and trailing whitespaces
1112

1213
console.log(trimmedContent);

0 commit comments

Comments
 (0)