diff --git a/entrypoint.sh b/entrypoint.sh index cd75246..a92d76e 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -30,6 +30,14 @@ require_env() { } write_output() { + # 1. 先抽取 $GITHUB_OUTPUT 檔案的父目錄路徑 + local output_dir + output_dir="$(dirname "$GITHUB_OUTPUT")" + + # 2. 強制建立該目錄(若不存在),避免 1.0.8 沙盒隔離導致路徑遺失 + mkdir -p "$output_dir" + + # 3. 安全地寫入變數 printf 'version=%s\n' "$1" >> "$GITHUB_OUTPUT" }