miden-crypto/scripts/check-changelog.sh
scripts/check-changelog.shRaw
1#!/bin/bash
2set -uo pipefail
3
4CHANGELOG_FILE="${1:-CHANGELOG.md}"
5
6if [ "${NO_CHANGELOG_LABEL}" = "true" ]; then
7 # 'no changelog' set, so finish successfully
8 echo "\"no changelog\" label has been set"
9 exit 0
10else
11 # a changelog check is required
12 # fail if the diff is empty
13 if git diff --exit-code "origin/${BASE_REF}" -- "${CHANGELOG_FILE}"; then
14 >&2 echo "Changes should come with an entry in the \"CHANGELOG.md\" file. This behavior
15can be overridden by using the \"no changelog\" label, which is used for changes
16that are trivial / explicitly stated not to require a changelog entry."
17 exit 1
18 fi
19
20 echo "The \"CHANGELOG.md\" file has been updated."
21fi