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