...
This commit is contained in:
+3
-2
@@ -12,7 +12,7 @@ PR_COMMENT_ID="${PR_COMMENT_ID:-}"
|
|||||||
PR_COMMENT_URI="${PR_COMMENT_URI:-}"
|
PR_COMMENT_URI="${PR_COMMENT_URI:-}"
|
||||||
GITHUB_TOKEN="${GITHUB_TOKEN:-}"
|
GITHUB_TOKEN="${GITHUB_TOKEN:-}"
|
||||||
|
|
||||||
# === Validate inputs =================================================
|
# === Validate required inputs ========================================
|
||||||
if [[ -z "$COMMENTER_TYPE" ]]; then
|
if [[ -z "$COMMENTER_TYPE" ]]; then
|
||||||
echo "❌ commenter_type is required."
|
echo "❌ commenter_type is required."
|
||||||
exit 1
|
exit 1
|
||||||
@@ -24,7 +24,7 @@ if [[ -z "$GITHUB_TOKEN" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# === Move into working directory if specified ========================
|
# === 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}"
|
TARGET_DIR="${GITHUB_WORKSPACE}/${WORKING_DIR}"
|
||||||
if [[ ! -d "$TARGET_DIR" ]]; then
|
if [[ ! -d "$TARGET_DIR" ]]; then
|
||||||
echo "❌ Error: Cannot change to working directory '${WORKING_DIR}'"
|
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"
|
echo "🔹 Changing to working directory: $WORKING_DIR"
|
||||||
cd "$TARGET_DIR"
|
cd "$TARGET_DIR"
|
||||||
else
|
else
|
||||||
|
echo "⚠️ Detected empty or numeric working_dir ('${WORKING_DIR:-unset}'); treating as unset."
|
||||||
cd "${GITHUB_WORKSPACE:-.}"
|
cd "${GITHUB_WORKSPACE:-.}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user