Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
chore: add changelog generation script
Browse files Browse the repository at this point in the history
  • Loading branch information
stfsy committed Aug 21, 2022
1 parent 61933ce commit 42759dd
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .get_latest_changes_for_release_notes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

CHANGELOG="CHANGELOG.md"
NEWLINE="\n"

first_release_processed='false'
has_linebreak='false'

text=''

while IFS= read -r line; do
if echo $line | grep -q -E '^<a *'; then
continue
fi

if echo $line | grep -q -E '^#[#]{1,2} [[]{1}.*|^<a *'; then
if [[ $first_release_processed == "false" ]]; then
first_release_processed="true"
else
break
fi
fi

if [[ -z $line ]]; then
if [[ $has_linebreak == 'false' ]]; then
has_linebreak='true'
else
continue
fi
else
has_linebreak='false'
fi

text="$text ${line} ${NEWLINE}"

done < "$CHANGELOG"

echo -e "$text"

0 comments on commit 42759dd

Please sign in to comment.