feat(antigravity): 安裝步驟新增 OAuth 空值檢查,缺少時直接失敗

This commit is contained in:
Jeffery
2026-06-29 16:41:21 +08:00
parent 3b882b73ce
commit a8b20f4cde
+8
View File
@@ -49,6 +49,14 @@ runs:
OAUTH: ${{ inputs.oauth }} OAUTH: ${{ inputs.oauth }}
# 執行 Antigravity CLI 安裝與 OAuth token 檔案建立流程。 # 執行 Antigravity CLI 安裝與 OAuth token 檔案建立流程。
run: | 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 官方安裝腳本; # 下載並以 bash 執行 Antigravity CLI 官方安裝腳本;
# curl -f 在 HTTP 錯誤時回傳非零,-sSL 為安靜模式並跟隨重導向,下載失敗時 pipeline 會中止。 # curl -f 在 HTTP 錯誤時回傳非零,-sSL 為安靜模式並跟隨重導向,下載失敗時 pipeline 會中止。
curl -fsSL https://antigravity.google/cli/install.sh | bash curl -fsSL https://antigravity.google/cli/install.sh | bash