From 680f467c2610d57691a7683b24fb644e7ee7c114 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Sat, 27 Jun 2026 15:49:01 +0000 Subject: [PATCH] =?UTF-8?q?feat(antigravity):=20=E6=94=B9=E7=94=B1=20repos?= =?UTF-8?q?itory=20variable=20=E8=AE=80=E5=8F=96=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- action.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/action.yml b/action.yml index 3c01280..f1c04b1 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,5 @@ # 用途:定義可在 GitHub Actions 中使用的 Antigravity CLI composite action,負責安裝 Antigravity CLI、設定 OAuth token、執行提示詞並輸出文字結果。 -# 更新日期:2026/06/27 23:21:07 +# 更新日期:2026/06/27 23:35:00 # 設定 action 顯示名稱,供 workflow 引用與介面顯示。 name: 'Antigravity CLI' @@ -17,12 +17,6 @@ inputs: required: false # 設定 prompt 的預設提示詞。 default: "請自我介紹" - # 定義 Antigravity CLI 執行時使用的模型輸入。 - model: - # 說明 model 輸入會指定 Antigravity CLI 使用的模型。 - description: 'Antigravity CLI 使用的模型' - # 要求呼叫端必須提供 model。 - required: true # 定義 base64 編碼後的 OAuth token 檔案內容輸入。 oauth: # 說明 oauth 輸入需提供 base64 編碼的 Antigravity OAuth token 檔案內容;不得在註解或日誌中輸出明文。 @@ -72,12 +66,18 @@ runs: id: antigravity # 宣告此步驟需要的環境變數。 env: - # 將呼叫端提供的 model input 放入 MODEL 環境變數。 - MODEL: ${{ inputs.model }} + # 從 repository variable 讀取 Antigravity CLI 使用的模型名稱。 + MODEL: ${{ vars.ANTIGRAVITY_MODEL }} # 將呼叫端提供的 prompt input 放入 PROMPT 環境變數。 PROMPT: ${{ inputs.prompt }} # 執行 Antigravity CLI,列印結果並寫入 GitHub Actions output。 run: | + # 確認呼叫端 repository 已設定 ANTIGRAVITY_MODEL variable。 + if [ -z "$MODEL" ]; then + echo 'ANTIGRAVITY_MODEL repository variable is required.' >&2 + exit 1 + fi + # 使用指定提示詞與模型執行 Antigravity CLI,並把標準輸出捕捉到 text 變數。 text="$(agy --print "$PROMPT" --model "$MODEL")" # 將 Antigravity CLI 回傳文字輸出到目前步驟日誌。