feat(antigravity): 改由 repository variable 讀取模型設定
This commit is contained in:
+9
-9
@@ -1,5 +1,5 @@
|
|||||||
# 用途:定義可在 GitHub Actions 中使用的 Antigravity CLI composite action,負責安裝 Antigravity CLI、設定 OAuth token、執行提示詞並輸出文字結果。
|
# 用途:定義可在 GitHub Actions 中使用的 Antigravity CLI composite action,負責安裝 Antigravity CLI、設定 OAuth token、執行提示詞並輸出文字結果。
|
||||||
# 更新日期:2026/06/27 23:21:07
|
# 更新日期:2026/06/27 23:35:00
|
||||||
|
|
||||||
# 設定 action 顯示名稱,供 workflow 引用與介面顯示。
|
# 設定 action 顯示名稱,供 workflow 引用與介面顯示。
|
||||||
name: 'Antigravity CLI'
|
name: 'Antigravity CLI'
|
||||||
@@ -17,12 +17,6 @@ inputs:
|
|||||||
required: false
|
required: false
|
||||||
# 設定 prompt 的預設提示詞。
|
# 設定 prompt 的預設提示詞。
|
||||||
default: "請自我介紹"
|
default: "請自我介紹"
|
||||||
# 定義 Antigravity CLI 執行時使用的模型輸入。
|
|
||||||
model:
|
|
||||||
# 說明 model 輸入會指定 Antigravity CLI 使用的模型。
|
|
||||||
description: 'Antigravity CLI 使用的模型'
|
|
||||||
# 要求呼叫端必須提供 model。
|
|
||||||
required: true
|
|
||||||
# 定義 base64 編碼後的 OAuth token 檔案內容輸入。
|
# 定義 base64 編碼後的 OAuth token 檔案內容輸入。
|
||||||
oauth:
|
oauth:
|
||||||
# 說明 oauth 輸入需提供 base64 編碼的 Antigravity OAuth token 檔案內容;不得在註解或日誌中輸出明文。
|
# 說明 oauth 輸入需提供 base64 編碼的 Antigravity OAuth token 檔案內容;不得在註解或日誌中輸出明文。
|
||||||
@@ -72,12 +66,18 @@ runs:
|
|||||||
id: antigravity
|
id: antigravity
|
||||||
# 宣告此步驟需要的環境變數。
|
# 宣告此步驟需要的環境變數。
|
||||||
env:
|
env:
|
||||||
# 將呼叫端提供的 model input 放入 MODEL 環境變數。
|
# 從 repository variable 讀取 Antigravity CLI 使用的模型名稱。
|
||||||
MODEL: ${{ inputs.model }}
|
MODEL: ${{ vars.ANTIGRAVITY_MODEL }}
|
||||||
# 將呼叫端提供的 prompt input 放入 PROMPT 環境變數。
|
# 將呼叫端提供的 prompt input 放入 PROMPT 環境變數。
|
||||||
PROMPT: ${{ inputs.prompt }}
|
PROMPT: ${{ inputs.prompt }}
|
||||||
# 執行 Antigravity CLI,列印結果並寫入 GitHub Actions output。
|
# 執行 Antigravity CLI,列印結果並寫入 GitHub Actions output。
|
||||||
run: |
|
run: |
|
||||||
|
# 確認呼叫端 repository 已設定 ANTIGRAVITY_MODEL variable。
|
||||||
|
if [ -z "$MODEL" ]; then
|
||||||
|
echo 'ANTIGRAVITY_MODEL repository variable is required.' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# 使用指定提示詞與模型執行 Antigravity CLI,並把標準輸出捕捉到 text 變數。
|
# 使用指定提示詞與模型執行 Antigravity CLI,並把標準輸出捕捉到 text 變數。
|
||||||
text="$(agy --print "$PROMPT" --model "$MODEL")"
|
text="$(agy --print "$PROMPT" --model "$MODEL")"
|
||||||
# 將 Antigravity CLI 回傳文字輸出到目前步驟日誌。
|
# 將 Antigravity CLI 回傳文字輸出到目前步驟日誌。
|
||||||
|
|||||||
Reference in New Issue
Block a user