Compare commits

...

1 Commits

Author SHA1 Message Date
Michael Crenshaw
c7a0dff47e chore: add security section to generated release notes
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-02-06 13:46:33 -05:00

View File

@@ -74,12 +74,13 @@ EOM
less_log=$(git log --pretty="format:%s %ae" --cherry-pick --left-only --no-merges "$new_ref...$old_ref")
more_log=$(git log --pretty="format:%s %ae" "$new_ref..$old_ref")
new_commits=$(diff --new-line-format="" --unchanged-line-format="" <(echo "$less_log") <(echo "$more_log") | grep -v "Merge pull request from GHSA")
new_commits=$(diff --new-line-format="" --unchanged-line-format="" <(echo "$less_log") <(echo "$more_log"))
new_commits_no_email=$(echo "$new_commits" | strip_last_word)
features=$(echo "$new_commits_no_email" | grep '^feat' | to_list_items)
fixes=$(echo "$new_commits_no_email" | grep '^fix' | to_list_items)
docs=$(echo "$new_commits_no_email" | grep '^docs' | to_list_items)
other=$(echo "$new_commits_no_email" | grep -v -e '^feat' -e '^fix' -e '^docs' -e '^\[Bot\]' | to_list_items)
other=$(echo "$new_commits_no_email" | grep -v -e '^feat' -e '^fix' -e '^docs' -e '^\[Bot\]' -e '^Merge pull request from GHSA-' -e '^Bump version' | to_list_items)
security=$(echo "$new_commits_no_email" | grep '^Merge pull request from GHSA-' | to_list_items)
contributors_num=$(echo "$new_commits" | only_last_word | sort -u | nonempty_line_count)
@@ -88,6 +89,7 @@ features_num=$(echo "$features" | nonempty_line_count)
fixes_num=$(echo "$fixes" | nonempty_line_count)
docs_num=$(echo "$docs" | nonempty_line_count)
other_num=$(echo "$other" | nonempty_line_count)
security_num=$(echo "$security" | nonempty_line_count)
previous_contributors=$(git log --pretty="format:%an %ae" "$old_ref" | sort -uf)
all_contributors=$(git log --pretty="format:%an %ae" "$new_ref" | sort -uf)
@@ -109,6 +111,13 @@ if [ "$new_contributors_num" -lt 20 ] && [ "$new_contributors_num" -gt 0 ]; then
echo "$new_contributors_names"
echo
fi
if [ "$security_num" -gt 0 ]; then
echo "### Security ($security_num)"
echo
echo "$security"
echo
fi
if [ "$features_num" -gt 0 ]; then
echo "### Features ($features_num)"
echo