chore(Docker action): 整理 Docker action 執行設定

This commit is contained in:
2026-06-29 10:49:22 +00:00
parent 0b59ca6023
commit 45b6abacc8
4 changed files with 29 additions and 96 deletions
+9 -30
View File
@@ -26,7 +26,7 @@ jobs:
id: release-tag-version
uses: https://gitea.jsc.idv.tw/composite-actions/release-tag-version@${{ vars.ACTION_RELEASE_TAG_VERSION }}
with:
is_beta: 'true'
is_beta: true
# job 識別碼:ai-code-review
ai-code-review:
# job 顯示名稱
@@ -34,43 +34,22 @@ jobs:
needs: release-tag-version
# 指定執行環境的 runner 標籤:ubuntu
runs-on: ubuntu
# 此 job 所需的權限設定
permissions:
# 對 repository 內容的寫入權限(讀寫程式碼/檔案)
contents: write
# 對 pull request 的寫入權限(讓 AI 可在 PR 上留言/審查)
pull-requests: write
# 對 issues 的寫入權限(建立/更新 issue 留言所需)
issues: write
# job 的執行步驟
steps:
- name: 取得程式碼
uses: actions/checkout@${{ vars.ACTION_CHECKOUT_VERSION }}
- name: 安裝 AI 工具
uses: https://gitea.jsc.idv.tw/composite-actions/codex@${{ vars.ACTION_CODEX_VERSION }}
with:
oauth: ${{ secrets.CODEX_OAUTH }}
- name: 檢查 AI 助理 CLI
shell: bash
run: |
set -e
tools="$(node --input-type=module -e "import { getLLMCLICommands } from './app/config.js'; console.log(getLLMCLICommands().join(' '));")"
found=""
for tool in $tools; do
if command -v "$tool" >/dev/null 2>&1; then
found="${found} ${tool}"
"$tool" --version || true
fi
done
if [ -z "$found" ]; then
echo "找不到可用的 AI 助理 CLI(需要 ${tools} 其中之一)" >&2
exit 1
fi
echo "可用 AI 助理 CLI:${found}"
- name: AI 程式碼審查
# 使用外部 composite action 執行審查邏輯。
# 版本由 release-tag-version 計算,便於在 PR 中測試目前 action 版本。
uses: https://gitea.jsc.idv.tw/docker-actions/ai-code-review@v${{ needs.release-tag-version.outputs.version }}
# 此 job 所需的權限設定
permissions:
# 對 repository 內容的寫入權限(讀寫程式碼/檔案)
contents: write
# 對 pull request 的寫入權限(讓 AI 可在 PR 上留言/審查)
pull-requests: write
# 對 issues 的寫入權限(建立/更新 issue 留言所需)
issues: write
# 傳遞給 composite action 的輸入參數
with:
# 留言用 token:取自 secret COMMENT_TOKEN,供 action 在 PR 上發布審查留言