diff --git a/action.yml b/action.yml index 1dfaf47..eb21737 100644 --- a/action.yml +++ b/action.yml @@ -13,7 +13,7 @@ runs: shell: bash run: | apt-get update - apt-get install -y --no-install-recommends gettext-base jq + apt-get install -y --no-install-recommends gettext-base jq ansifilter npm install -g @openai/codex - name: Run Codex Bot diff --git a/scripts/run-codex.sh b/scripts/run-codex.sh index 95ff125..87f2a68 100644 --- a/scripts/run-codex.sh +++ b/scripts/run-codex.sh @@ -17,9 +17,11 @@ post_comment() { } if ! codex login status > /dev/null 2>&1; then - codex login --device-auth > "${OUTPUT_FILE}" 2>&1 & + LOGIN_FILE="$(mktemp)" + codex login --device-auth > "${LOGIN_FILE}" 2>&1 & LOGIN_PID="${!}" sleep 3 + ansifilter < "${LOGIN_FILE}" > "${OUTPUT_FILE}" post_comment wait "${LOGIN_PID}" exit 1