This commit is contained in:
2025-11-09 06:19:59 -05:00
parent 359aa1522f
commit 260016a55b
+3 -2
View File
@@ -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