refactor(codex): move email validation into main execution step and remove redundant check
CI / Release Tag Version (pull_request) Successful in 3s
CI / Codex (pull_request) Failing after 23s

This commit is contained in:
2026-06-29 05:58:47 +00:00
parent a309afdf58
commit 4077596fcc
+13 -17
View File
@@ -36,13 +36,22 @@ runs:
id: codex
env:
MODEL: ${{ vars.CODEX_MODEL }}
EXPECTED_EMAIL: ${{ vars.CODEX_EMAIL }}
PROMPT: ${{ inputs.prompt }}
run: |
if [ -z "$MODEL" ]; then
echo 'CODEX_MODEL repository variable is required.' >&2
exit 1
fi
if [ -z "$EXPECTED_EMAIL" ]; then
echo 'CODEX_EMAIL repository variable is required.' >&2
exit 1
fi
if [ -z "$PROMPT" ]; then
email="$(python3 "$GITHUB_ACTION_PATH/app/codex_account.py")"
echo "text=$email" >> "$GITHUB_OUTPUT"
exit 0
fi
text="$(codex exec --skip-git-repo-check -s danger-full-access --model "$MODEL" "$PROMPT")"
printf '%s\n' "$text"
{
@@ -51,19 +60,6 @@ runs:
echo 'CODEX_OUTPUT'
} >> "$GITHUB_OUTPUT"
shell: bash
- name: 驗證登入帳號
env:
EXPECTED_EMAIL: ${{ vars.CODEX_EMAIL }}
run: |
if [ -z "$EXPECTED_EMAIL" ]; then
echo 'CODEX_EMAIL repository variable is required.' >&2
exit 1
fi
email="$(python3 "$GITHUB_ACTION_PATH/app/codex_account.py")"
if [ "$email" != "$EXPECTED_EMAIL" ]; then
echo '登入帳號與 CODEX_EMAIL 不符' >&2
exit 1
fi
echo '登入帳號驗證通過'
shell: bash
- name: 檢查輸出
if: ${{ steps.codex.outputs.text != vars.ANTIGRAVITY_EMAIL }}
run: exit 1