diff --git a/action.yml b/action.yml index f5c0c14..18cb39d 100644 --- a/action.yml +++ b/action.yml @@ -49,6 +49,14 @@ runs: OAUTH: ${{ inputs.oauth }} # 執行 Antigravity CLI 安裝與 OAuth token 檔案建立流程。 run: | + # 前置檢查:確認 OAUTH 不為空;為空代表呼叫端未提供 secrets.ANTIGRAVITY_OAUTH。 + if [ -z "$OAUTH" ]; then + # 將錯誤訊息輸出到標準錯誤,提示需提供 oauth input。 + echo 'oauth input (secrets.ANTIGRAVITY_OAUTH) is required and must not be empty.' >&2 + # 以非零退出碼結束步驟,使整個 action 失敗,避免後續寫入空白 token。 + exit 1 + fi + # 下載並以 bash 執行 Antigravity CLI 官方安裝腳本; # curl -f 在 HTTP 錯誤時回傳非零,-sSL 為安靜模式並跟隨重導向,下載失敗時 pipeline 會中止。 curl -fsSL https://antigravity.google/cli/install.sh | bash