openai / openai/codex-action

[BUG] `drop-sudo` fails when Node is outside sudo's PATH

Open Beginner friendly
#180 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.2k
Forks
170
PR merge metrics
No merged PRs in 30d

Description

The action fails on our self-hosted Linux runner with safety-strategy: drop-sudo:

  sudo: node: command not found

The action installs Node successfully through actions/setup-node. However, src/dropSudo.ts then invokes:

sudo -n node .../dist/main.js drop-sudo --root-phase --user runner --group sudo

Sudo cannot find Node through its executable search path. The step fails before codex exec starts.

Action revision: 52fe01ec70a42f454c9d2ebd47598f9fd6893d56 (v1.11)
Codex version: 0.149.0
Node version: 24.21.0

Expected behavior: the action uses the available Node executable when it invokes its privileged setup phase.

Suggested fix: replace "node" with process.execPath in the sudo argument list. This avoids dependence on sudo's PATH.

Source:
https://github.com/openai/codex-action/blob/52fe01ec70a42f454c9d2ebd47598f9fd6893d56/src/dropSudo.ts#L48-L52

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/dropSudo.ts at lines 48-52 and inspect the privileged setup invocation and available Node executable. Reproduce the action on a self-hosted Linux runner where Node is outside sudo's PATH. Done means the drop-sudo phase completes and codex exec starts without the sudo: node: command not found error.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
ci-cd, devops
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
92/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.