Files
bot-agents/scripts/run-codex.sh
T

28 lines
637 B
Bash

#!/usr/bin/env bash
set -euo pipefail
. "${ACTION_PATH}/scripts/lib.sh"
configure_git_author
if ! codex login status > /dev/null 2>&1; then
codex login --device-auth 2>&1 | ansifilter > "${COMMENT_FILE}" &
LOGIN_PID="${!}"
sleep 3
post_comment
wait "${LOGIN_PID}"
codex login status 2>&1 | ansifilter > "${COMMENT_FILE}"
post_comment
fi
FINAL_PROMPT="$(render_prompt)"
# The reviewer token is unset so the agent cannot approve as the bot.
env -u REVIEWER_TOKEN \
codex exec --model gpt-5.5 \
--dangerously-bypass-approvals-and-sandbox \
--output-last-message "${COMMENT_FILE}" \
"${FINAL_PROMPT}"
post_result