Skip to content

Commit

Permalink
ci: update changelog parser
Browse files Browse the repository at this point in the history
  • Loading branch information
tompsota committed Jul 2, 2024
1 parent 2e28455 commit fcd0c89
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions scripts/extract_changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit fcd0c89

Please sign in to comment.