From 5d81bd072ae27afdfc8213639c2428c5b75f9f64 Mon Sep 17 00:00:00 2001 From: Aam Date: Fri, 27 Sep 2024 13:15:15 +0200 Subject: [PATCH] fix(bumper): fix unbound variable on new repo (#31) ## Summary by CodeRabbit - **Bug Fixes** - Improved the handling of version variables to prevent errors when they are unset or null. - **Refactor** - Enhanced the robustness of string construction in the status message generation process. --- lib/message.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/message.sh b/lib/message.sh index 2f04122..124e971 100644 --- a/lib/message.sh +++ b/lib/message.sh @@ -14,7 +14,7 @@ make_pr_status() { ADDITIONAL_INFO="" if [[ -n "${BUMPER_CURRENT_VERSION:-}" ]]; then - COMPARE="**Changes**: [${BUMPER_CURRENT_VERSION}...${head_label}](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/compare/${BUMPER_CURRENT_VERSION}...${head_label})" + COMPARE="**Changes**: [${BUMPER_CURRENT_VERSION:-}...${head_label}](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/compare/${BUMPER_CURRENT_VERSION:-}...${head_label})" fi if [[ -n "${INPUT_BUMP_SEMVER}" && "${INPUT_BUMP_SEMVER}" == "true" ]]; then