feat(Codex CLI): 輸出 Codex 執行結果
CI / 計算版本號 (pull_request) Successful in 2s
CI / 品質檢查 (pull_request) Failing after 2s
AI / Code Review (pull_request) Failing after 40s

This commit is contained in:
2026-06-24 10:35:11 +00:00
parent c77a928bb2
commit 8e93f126c0
2 changed files with 24 additions and 2 deletions
+22 -2
View File
@@ -33,10 +33,30 @@ mv "$auth_file" "$CODEX_HOME/auth.json"
chmod 600 "$CODEX_HOME/auth.json"
trap - EXIT
codex_output="$(mktemp)"
trap 'rm -f "$codex_output"' EXIT
set +e
codex exec \
--model "$MODEL" \
"$PROMPT"
"$PROMPT" 2>&1 | tee "$codex_output"
codex_status="${PIPESTATUS[0]}"
set -e
if [[ -n "${GITHUB_OUTPUT:-}" ]]; then
echo "status=completed" >> "$GITHUB_OUTPUT"
output_delimiter="CODEX_OUTPUT_$(date +%s)_$$"
if [[ "$codex_status" -eq 0 ]]; then
echo "status=completed" >> "$GITHUB_OUTPUT"
else
echo "status=failed" >> "$GITHUB_OUTPUT"
fi
{
echo "output<<$output_delimiter"
cat "$codex_output"
echo "$output_delimiter"
} >> "$GITHUB_OUTPUT"
fi
exit "$codex_status"