From 680f467c2610d57691a7683b24fb644e7ee7c114 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Sat, 27 Jun 2026 15:49:01 +0000 Subject: [PATCH 1/2] =?UTF-8?q?feat(antigravity):=20=E6=94=B9=E7=94=B1=20r?= =?UTF-8?q?epository=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 回傳文字輸出到目前步驟日誌。 -- 2.53.0 From 3f81b7c8c9468635d17806509c343faa28292937 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Sat, 27 Jun 2026 15:49:05 +0000 Subject: [PATCH 2/2] =?UTF-8?q?docs(README):=20=E6=9B=B4=E6=96=B0=20Antigr?= =?UTF-8?q?avity=20action=20=E5=91=BC=E5=8F=AB=E7=AF=84=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0af89d0..333edd5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Antigravity CLI Composite Action -更新時間:2026/06/27 23:24:37 +更新時間:2026/06/27 23:35:00 此 repository 提供一個 Gitea/GitHub Actions composite action,用於安裝 Antigravity CLI、寫入 OAuth token、執行指定提示詞,並將 CLI 輸出寫入 action output。 @@ -10,7 +10,7 @@ | 專案名稱 | 專案描述 | | --- | --- | -| [antigravity](https://gitea.jsc.idv.tw/composite-actions/antigravity/src/branch/ai-review-resolve/develop-20260627-142726) | 提供 Antigravity CLI composite action,讓 workflow 可透過 `oauth`、`model` 與 `prompt` 輸入執行 CLI 並取得文字輸出。 | +| [antigravity](https://gitea.jsc.idv.tw/composite-actions/antigravity/src/branch/ai-review-resolve/develop-20260627-142726) | 提供 Antigravity CLI composite action,讓 workflow 可透過 `oauth` 與 `prompt` 輸入執行 CLI,並從 repository variable 讀取模型名稱後取得文字輸出。 | ### 參考專案 @@ -32,7 +32,7 @@ ### 在 workflow 中呼叫 Antigravity CLI -以下範例示範在 workflow step 中呼叫此 composite action,傳入 OAuth token、模型名稱與提示詞,並在後續步驟讀取 `text` output。 +以下範例示範在 workflow step 中呼叫此 composite action,傳入 OAuth token 與提示詞,並在後續步驟讀取 `text` output。模型名稱由 action 直接讀取 `vars.ANTIGRAVITY_MODEL`。 ```yaml - name: 執行 Antigravity CLI @@ -40,7 +40,6 @@ uses: https://gitea.jsc.idv.tw/composite-actions/antigravity@v1 with: oauth: ${{ secrets.ANTIGRAVITY_OAUTH }} - model: ${{ vars.ANTIGRAVITY_MODEL }} prompt: "請自我介紹" - name: 使用輸出文字 -- 2.53.0