ci(mantis): preserve codex action home through sudo

This commit is contained in:
Ayaan Zaidi
2026-05-11 11:20:25 +05:30
parent b66c3b4fc3
commit d246b3e2de

View File

@@ -346,6 +346,8 @@ jobs:
run: |
set -euo pipefail
sudo useradd --create-home --shell /bin/bash codex
printf '%s\n' 'Defaults env_keep += "CODEX_HOME CODEX_INTERNAL_ORIGINATOR_OVERRIDE"' | sudo tee /etc/sudoers.d/mantis-codex-env >/dev/null
sudo chmod 0440 /etc/sudoers.d/mantis-codex-env
codex_home="/tmp/mantis-codex-home-${GITHUB_RUN_ID}"
sudo install -d -m 0770 -o codex -g codex "$codex_home"
sudo setfacl -m u:runner:rwx,u:codex:rwx "$codex_home"