b8520349172427de98d839d8878541b8b35e60c5
actions/composite-template: CI / BUILD (pull_request) Successful in 3s
actions/composite-template: CI / TEST (pull_request) Successful in 53s
actions/composite-template: CI / RESULT (pull_request) Successful in 3s
actions/ci: CI / BUILD (pull_request) Successful in 3s
workflows/ci: CI / BUILD (pull_request) Successful in 3s
actions/ci: CI / AI Code Review (pull_request) Successful in 2m13s
workflows/ci: CI / AI Code Review (pull_request) Successful in 49s
CI / TEST (pull_request) Successful in 1m7s
CI / RESULT (pull_request) Successful in 1s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
setup-codex
更新時間:2026/07/11 18:39:51(Asia/Taipei)
setup-codex 是一個 Gitea composite action,用於在 Gitea Actions runner 上安裝並登入 Codex CLI,讓後續 workflow 步驟能直接呼叫已完成 OAuth 登入的 codex 指令。本 repo 由 action 定義(action.yml)與示範用的 CI/CD workflow 組成,內容皆為 YAML 與少量 shell/Node。
專案列表
專案描述
| 專案名稱 | 專案描述 |
|---|---|
| setup-codex | Gitea composite action:安裝 Codex CLI、以 base64 編碼的 OAuth 驗證檔完成登入,並透過 workflow 範例展示如何在 CI/CD 中串接 Codex。 |
參考專案
| 專案名稱 | 參考專案列表 |
|---|---|
| setup-codex | 無 |
NuGet 套件
| 專案名稱 | NuGet 套件列表 |
|---|---|
| setup-codex | 無 |
功能列表
本專案未公開可列入 README 的功能(public method/constructor/extension method/operator)。
| 功能名稱 | 功能描述 |
|---|---|
| (無) | 此專案未公開可列入 README 的功能。 |
使用範例
在 workflow 中引用 action
在同一個 repo 內,可用相對路徑 ./ 引用本 action;跨 repo 則以 owner/repo@版本 引用。此 action 需要一個必填參數 oauth(透過 OAuth 登入 ChatGPT 產生、並經 base64 編碼的驗證檔內容,建議存放於 secrets)。
jobs:
demo:
runs-on: ubuntu
steps:
- name: Source Code Checkout
uses: actions/checkout@v4
- name: Run Setup Codex
uses: ./
with:
oauth: ${{ secrets.CODEX_OAUTH }}
- name: Execute Codex
shell: bash
run: codex exec "請你進行自我介紹"
前置條件與注意事項
oauth:必填。內容為 Codex/ChatGPT OAuth 驗證檔(auth.json)先經 base64 編碼後的字串,請存於 secret(例如CODEX_OAUTH)避免外洩。- action 會在 runner 家目錄產生
~/.codex/auth.json(含機敏憑證),並將 Codex 執行檔目錄加入PATH。 - action 內建的
Show Codex Account步驟會將登入帳號的 email 輸出到 workflow log,請留意 log 的存取權限與隱私。 outputs.message目前參照的steps.exchange步驟不存在,屬於既有問題,需人工確認。
對應的 workflow 檔案
| 檔案 | 觸發時機 | 用途 |
|---|---|---|
| action.yml | 被其他 workflow 以 uses 引用 |
定義安裝/登入 Codex 的 composite action。 |
| .gitea/workflows/ci.yaml | base 為 master/develop 的 Pull Request(opened/synchronize) |
發佈 beta Release;build 依 base_ref == 'develop' 設定 IS_BETA 並輸出 is_beta,當 is_beta == 'true'(即 develop 的 PR)時執行本 action 以 codex exec 產生自我介紹、顯示結果。 |
| .gitea/workflows/master.yaml | push 至 master |
反查指定 commit 所屬的 git tag 並顯示。 |
Description
Set up the Codex CLI to Gitea Action
https://gitea.jsc.idv.tw/actions/setup-codex
100 KiB
Releases
6
setup-codex v0.0.1
Latest