-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add release notes parser and release update action
- Loading branch information
1 parent
f9a9763
commit 8215fb1
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
# -e Exit immediately if a command exits with a non-zero status. | ||
# -u Treat unset variables as an error when substituting. | ||
|
||
set -eu | ||
set -o pipefail | ||
|
||
# Get Release notes for the latest release from CHANGELOG.md | ||
# How to use: | ||
# release-notes.sh CHANGELOG.md > ReleaseNotes.md | ||
|
||
startline=$(($(cat "$1" | grep -nE '^## \[v[0-9]+' | head -n 1 | tail -n 1 | cut -d ":" -f 1) + 1)) | ||
finishline=$(($(cat "$1" | grep -nE '^## \[v[0-9]+' | head -n 2 | tail -n 1 | cut -d ":" -f 1) - 1)) | ||
changelog=$(sed -n "${startline},${finishline}p" "$1"); | ||
|
||
echo "${changelog}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters