Skip to content

Commit

Permalink
DAS-2146: Exclude Links from extracted release notes.
Browse files Browse the repository at this point in the history
  • Loading branch information
flamingbear committed May 30, 2024
1 parent 6285d4c commit 1f858ef
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions bin/extract-release-notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,20 @@
###############################################################################

CHANGELOG_FILE="CHANGELOG.md"
VERSION_PATTERN="^## \[v"

## captures versions
## >## v1.0.0
## >## [v1.0.0]
VERSION_PATTERN="^## [\[]v"

## captures url links
## [unreleased]:https://github.com/nasa/harmony-browse-image-generator/compare/1.2.0..HEAD
## [v1.2.0]: https://github.com/nasa/harmony-browse-image-generator/compare/1.1.0..1.2.0
LINK_PATTERN="^\[.*\].*\.\..*"

# Read the file and extract text between the first two occurrences of the
# VERSION_PATTERN
result=$(awk "/$VERSION_PATTERN/{c++; if(c==2) exit;} c==1" "$CHANGELOG_FILE")

# Print the result
echo "$result" | grep -v "$VERSION_PATTERN"
echo "$result" | grep -v "$VERSION_PATTERN" | grep -v "$LINK_PATTERN"

0 comments on commit 1f858ef

Please sign in to comment.