From 260016a55be916db39380ff2b3f9f29a93934255 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Sun, 9 Nov 2025 06:19:59 -0500 Subject: [PATCH] ... --- tf-pr-comment.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tf-pr-comment.sh b/tf-pr-comment.sh index 7594ec8..093ff0d 100644 --- a/tf-pr-comment.sh +++ b/tf-pr-comment.sh @@ -12,7 +12,7 @@ PR_COMMENT_ID="${PR_COMMENT_ID:-}" PR_COMMENT_URI="${PR_COMMENT_URI:-}" GITHUB_TOKEN="${GITHUB_TOKEN:-}" -# === Validate inputs ================================================= +# === Validate required inputs ======================================== if [[ -z "$COMMENTER_TYPE" ]]; then echo "❌ commenter_type is required." exit 1 @@ -24,7 +24,7 @@ if [[ -z "$GITHUB_TOKEN" ]]; then fi # === Move into working directory if specified ======================== -if [[ -n "$WORKING_DIR" ]]; then +if [[ -n "$WORKING_DIR" && "$WORKING_DIR" != "0" ]]; then TARGET_DIR="${GITHUB_WORKSPACE}/${WORKING_DIR}" if [[ ! -d "$TARGET_DIR" ]]; then echo "❌ Error: Cannot change to working directory '${WORKING_DIR}'" @@ -33,6 +33,7 @@ if [[ -n "$WORKING_DIR" ]]; then echo "🔹 Changing to working directory: $WORKING_DIR" cd "$TARGET_DIR" else + echo "⚠️ Detected empty or numeric working_dir ('${WORKING_DIR:-unset}'); treating as unset." cd "${GITHUB_WORKSPACE:-.}" fi