1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Codex CIモードをGithub Actionsで試してみた!

Posted at

はじめに

CodexのCIモードをGithub Actions試してみました。

公式サンプル

- name: Update changelog via Codex
  run: |
    npm install -g @openai/codex
    codex login --api-key "${{ secrets.OPENAI_KEY }}"
    codex exec --full-auto "update CHANGELOG for next release"

実装してみた

.github/workflows/codex.yml

name: Hello Codex
on:
  workflow_dispatch:

jobs:
  codex:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v5

      - name: Setup Node.js
        uses: actions/setup-node@v5
        with:
          node-version: 24

      - name: Hello Codex
        run: |
          npm install -g @openai/codex
          mkdir ~/.codex
          codex login --api-key "${{ secrets.OPENAI_KEY }}"
          codex exec --full-auto "こんにちは!"

codexコマンドの実行前に.codexディレクトリが存在しないと以下のエラーが出ます。

Error logging in: No such file or directory (os error 2)
Error: Process completed with exit code 1.

ワークフロー実行

コマンドまたは画面から手動で実行します。

gh workflow run codex.yml

出力結果

Successfully logged in
[2025-09-19T06:43:04] OpenAI Codex v0.39.0 (research preview)
--------
workdir: /home/runner/work/codex-cli-actions/codex-cli-actions
model: gpt-5
provider: openai
approval: never
sandbox: workspace-write [workdir, /tmp, $TMPDIR]
reasoning effort: none
reasoning summaries: auto
--------
[2025-09-19T06:43:04] User instructions:
こんにちは!

[2025-09-19T06:43:08] thinking

こんにちは!今日は何をお手伝いできますか? I think it's best to keep things simple and friendly. There's no need for tools or extra explanations. Just providing that greeting should be enough! I want to ensure my response aligns with the tone guidelines and feels welcoming. Let’s keep it straightforward, focusing on how I can assist without getting too complicated.

参考

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?