feat(codex): 新增 Codex CLI composite action #1

Merged
admin merged 15 commits from ai-review-resolve/develop-20260629-115924 into develop 2026-06-29 06:17:23 +00:00
2 changed files with 14 additions and 14 deletions
Showing only changes of commit d05610d4e5 - Show all commits
-4
View File
@@ -28,8 +28,4 @@ jobs:
id: codex id: codex
uses: https://gitea.jsc.idv.tw/composite-actions/codex@v${{ needs.release-tag-version.outputs.version }} uses: https://gitea.jsc.idv.tw/composite-actions/codex@v${{ needs.release-tag-version.outputs.version }}
with: with:
oauth: ${{ secrets.CODEX_OAUTH }}
prompt: "請自我介紹" prompt: "請自我介紹"
- name: 檢查登入帳號
if: ${{ steps.codex.outputs.email != vars.CODEX_EMAIL }}
run: exit 1
+14 -10
View File
@@ -6,22 +6,16 @@ inputs:
description: '傳給 Codex CLI 的提示詞' description: '傳給 Codex CLI 的提示詞'
required: false required: false
default: "請自我介紹" default: "請自我介紹"
oauth:
description: 'base64 編碼的 Codex OAuth token 檔案內容'
required: true
outputs: outputs:
text: text:
description: '輸出的文字' description: '輸出的文字'
value: ${{ steps.codex.outputs.text }} value: ${{ steps.codex.outputs.text }}
email:
description: '目前登入帳號的電子郵件(由 codex app-server account/read 取得)'
value: ${{ steps.account.outputs.email }}
runs: runs:
using: 'composite' using: 'composite'
steps: steps:
- name: 安裝工具 - name: 安裝工具
env: env:
OAUTH: ${{ inputs.oauth }} OAUTH: ${{ secrets.CODEX_OAUTH }}
run: | run: |
npm install -g @openai/codex npm install -g @openai/codex
@@ -49,9 +43,19 @@ runs:
echo 'CODEX_OUTPUT' echo 'CODEX_OUTPUT'
} >> "$GITHUB_OUTPUT" } >> "$GITHUB_OUTPUT"
shell: bash shell: bash
- name: 取得登入帳號 - name: 驗證登入帳號
id: account env:
EXPECTED_EMAIL: ${{ vars.CODEX_EMAIL }}
run: | run: |
if [ -z "$EXPECTED_EMAIL" ]; then
echo 'CODEX_EMAIL repository variable is required.' >&2
exit 1
fi
email="$(python3 "$GITHUB_ACTION_PATH/app/codex_account.py")" email="$(python3 "$GITHUB_ACTION_PATH/app/codex_account.py")"
printf 'email=%s\n' "$email" >> "$GITHUB_OUTPUT" if [ "$email" != "$EXPECTED_EMAIL" ]; then
echo '登入帳號與 CODEX_EMAIL 不符' >&2
exit 1
fi
echo '登入帳號驗證通過'
shell: bash shell: bash