-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inspired from changelog-check-action
- Loading branch information
Showing
2 changed files
with
27 additions
and
11 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
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,19 @@ | ||
#!/bin/bash | ||
set -uo pipefail | ||
|
||
CHANGELOG_FILE="${1:-CHANGES.md}" | ||
|
||
if [ "${NO_CHANGELOG_LABEL}" = "true" ]; then | ||
# 'no changelog' set, so finish successfully | ||
echo "::info no changelog label has been set" | ||
exit 0 | ||
else | ||
# a changelog check is required | ||
# fail if the diff is empty | ||
if git diff --exit-code "origin/${BASE_REF}" -- "${CHANGELOG_FILE}"; then | ||
>&2 echo "::warning Changes should come with an entry in the CHANGELOG.md file. This behavior | ||
can be overridden by using the \"no changelog\" label, which is used for changes | ||
that trivial / explicitely decided not to need a changelog entry." | ||
exit 1 | ||
fi | ||
fi |