From ccbd4ee971d1bb794e90363c127f0deca5ab4558 Mon Sep 17 00:00:00 2001 From: Ocheretovich Date: Thu, 16 Apr 2026 10:38:44 +0300 Subject: [PATCH 1/2] fix: avoid unbound variable errors for NO_CHANGELOG_LABEL and BASE_REF --- scripts/check-changelog.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/check-changelog.sh b/scripts/check-changelog.sh index 7d7529daa2..3569b31caa 100755 --- a/scripts/check-changelog.sh +++ b/scripts/check-changelog.sh @@ -1,9 +1,11 @@ #!/bin/bash set -uo pipefail +: "${BASE_REF:?BASE_REF is not set}" + CHANGELOG_FILE="${1:-CHANGELOG.md}" -if [ "${NO_CHANGELOG_LABEL}" = "true" ]; then +if [ "${NO_CHANGELOG_LABEL:-false}" = "true" ]; then # 'no changelog' set, so finish successfully echo "\"no changelog\" label has been set" exit 0 From 4b497bea4d529993e281dce8514717a0e7823045 Mon Sep 17 00:00:00 2001 From: Ocheretovich Date: Mon, 20 Apr 2026 09:06:56 +0300 Subject: [PATCH 2/2] fix: check BASE_REF only when needed --- scripts/check-changelog.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/check-changelog.sh b/scripts/check-changelog.sh index 3569b31caa..e36238e3d4 100755 --- a/scripts/check-changelog.sh +++ b/scripts/check-changelog.sh @@ -1,8 +1,6 @@ #!/bin/bash set -uo pipefail -: "${BASE_REF:?BASE_REF is not set}" - CHANGELOG_FILE="${1:-CHANGELOG.md}" if [ "${NO_CHANGELOG_LABEL:-false}" = "true" ]; then @@ -10,6 +8,7 @@ if [ "${NO_CHANGELOG_LABEL:-false}" = "true" ]; then echo "\"no changelog\" label has been set" exit 0 else + : "${BASE_REF:?BASE_REF is not set}" # a changelog check is required # fail if the diff is empty if git diff --exit-code "origin/${BASE_REF}" -- "${CHANGELOG_FILE}"; then