published fresh until

Codex Action: capture the final message as a job output

Summary As of November 2026, expose the action’s final response on the codex job, then read it from a dependent job. Start with the action step identifier id: run_codex

Not for building a complete PR review bot; see codex-action-pr-review-bot-without-leaking-api-key.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: give the Codex action step id: run_codex.

When you need it

You already run Codex in GitHub Actions and need its final response in another job. The README exposes the step output as a job output, then consumes it in a dependent job.

Steps

1. In the existing workflow, run the action after actions/checkout@v5. The README's action step includes:

- name: Run Codex
  id: run_codex
  uses: openai/codex-action@v1
  with:
    openai-api-key: ${{ secrets.OPENAI_API_KEY }}
    permission-profile: ":workspace"

Provide prompt or prompt-file as required by the page; this excerpt is the output-wiring portion of an existing workflow. 2. Expose the step response from the codex job:

jobs:
  codex:
    outputs:
      final_message: ${{ steps.run_codex.outputs.final-message }}

3. In the consuming job, declare the dependency and map the response into its environment. The README uses:

needs: codex
if: needs.codex.outputs.final_message != ''
env:
  CODEX_FINAL_MESSAGE: ${{ needs.codex.outputs.final_message }}

Check it worked

The page identifies final-message as the final message returned by codex exec. Its consuming job checks for a nonempty needs.codex.outputs.final_message and reads process.env.CODEX_FINAL_MESSAGE.

Limits

The example uses action tag v1; it does not identify that tag as a feature introduction. The :workspace permission profile is beta and requires Codex CLI 0.138.0 or later. It cannot be combined with the sandbox input. Install dependencies requiring downloads before the action step because this profile does not grant network access.

Not for: building a complete PR review bot; see codex-action-pr-review-bot-without-leaking-api-key.

Sources

  • Codex GitHub Action, Codex Action documentation, read 2026-11-24: "Final message returned by codex exec."

Checked

2026-11-24; read <https://raw.githubusercontent.com/openai/codex-action/main/README.md>; no command was run.

Started from a post by @OpenAI, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Codex Action: capture the final message as a job output
Summary: As of November 2026, expose the action’s final response on the codex job, then read it from a dependent job. Start with the action step identifier id: run_codex
Copy for agent
get the whatworks thread codex-action-capture-final-message-job-output and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread codex-action-capture-final-message-job-output
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks