File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,6 +49,22 @@ normalize_remote_url() {
4949 esac
5050}
5151
52+ subject_highlight () {
53+ local subject=" $1 "
54+ subject=" $( printf ' %s' " $subject " | sed -E ' s/^[a-z]+(\([^)]+\))?:[[:space:]]*//' ) "
55+ printf ' %s' " $subject " | awk '
56+ {
57+ line = $0
58+ if (length(line) == 0) next
59+ first = substr(line, 1, 1)
60+ rest = substr(line, 2)
61+ line = toupper(first) rest
62+ if (line !~ /[.!?]$/) line = line "."
63+ print line
64+ }
65+ '
66+ }
67+
5268TAG=" ${1:- ${GITHUB_REF_NAME:- } } "
5369OUT_PATH=" ${2:- $ROOT_DIR / dist/ release-notes.md} "
5470
108124 printf ' %s\n\n' " $UNRELEASED_SECTION "
109125 printf ' _Source: `docs/CHANGELOG.md` `Unreleased` section at tag time._\n\n'
110126 else
111- printf ' No curated changelog entry was present for this tag, so the notes below are generated from the exact tagged commit range.\n\n'
127+ if [[ -z " $COMMITS " ]]; then
128+ printf ' - No recorded changes found for `%s`.\n\n' " $TAG "
129+ else
130+ while IFS=$' \t ' read -r sha subject; do
131+ highlight=" $( subject_highlight " $subject " ) "
132+ if [[ -n " $highlight " ]]; then
133+ printf -- ' - %s\n' " $highlight "
134+ fi
135+ done <<< " $COMMITS"
136+ printf ' \n'
137+ fi
112138 fi
113139
114140 printf ' ## Included Commits\n\n'
You can’t perform that action at this time.
0 commit comments