Automate feature changelog checking (#27450)

* Automate feature changelog checking

* Add changelog for testing

* Simplify check

* Forgot the end of line thing

* Escape the characters

* More testing

* Last test?

* Delete test changelog
This commit is contained in:
Violet Hynes
2024-06-12 08:54:29 -04:00
committed by GitHub
parent 405a3f426f
commit 2db5d6aa54

View File

@@ -48,8 +48,8 @@ jobs:
echo "Not found."
echo ""
echo "Did not find a changelog entry named ${expected_changelog_file}"
echo "If your changelog file is correct, skip this check with the 'pr/no-changelog' label"
echo "Reference - https://github.com/hashicorp/vault/pull/10363 and https://github.com/hashicorp/vault/pull/11894"
echo "If your changelog file is correct, or this change does not need a changelog, skip this check with the 'pr/no-changelog' label"
echo "Reference - https://github.com/hashicorp/vault/blob/main/CONTRIBUTING.md#changelog-entries"
exit 1
fi
@@ -76,6 +76,12 @@ jobs:
elif grep -q ':fix$' "$changelog_files"; then
echo "Found invalid type (fix) in changelog - did you mean bug?"
exit 1
elif grep -q ':feature$' "$changelog_files"; then
if ! grep -q '^\*\*' "$changelog_files"; then
echo "Feature changelogs must be formatted like the following:"
echo "**Feature Name**: Feature description"
exit 1
fi
elif ! grep -q '```release-note:' "$changelog_files"; then
# People often make changelog files like ```changelog:, which is incorrect.
echo "Changelog file did not contain 'release-note' heading - check formatting."