Compare commits
2 Commits
c64f1fdbf6
...
a192aa39d1
| Author | SHA1 | Date | |
|---|---|---|---|
| a192aa39d1 | |||
| 162ef3cd7b |
@@ -4,10 +4,10 @@ set -euo pipefail
|
|||||||
git config --global user.name bot
|
git config --global user.name bot
|
||||||
git config --global user.email noreply@capsulizers.com
|
git config --global user.email noreply@capsulizers.com
|
||||||
|
|
||||||
OUTPUT_FILE="$(mktemp)"
|
COMMENT_FILE="$(mktemp)"
|
||||||
|
|
||||||
post_comment() {
|
post_comment() {
|
||||||
COMMENT_JSON="$(jq -n --rawfile body "${OUTPUT_FILE}" '{body: $body}')"
|
COMMENT_JSON="$(jq -n --rawfile body "${COMMENT_FILE}" '{body: $body}')"
|
||||||
curl --fail-with-body --silent --show-error \
|
curl --fail-with-body --silent --show-error \
|
||||||
-X POST \
|
-X POST \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
@@ -17,14 +17,13 @@ post_comment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ! codex login status > /dev/null 2>&1; then
|
if ! codex login status > /dev/null 2>&1; then
|
||||||
LOGIN_FILE="$(mktemp)"
|
codex login --device-auth 2>&1 | ansifilter > "${COMMENT_FILE}" &
|
||||||
codex login --device-auth > "${LOGIN_FILE}" 2>&1 &
|
|
||||||
LOGIN_PID="${!}"
|
LOGIN_PID="${!}"
|
||||||
sleep 3
|
sleep 3
|
||||||
ansifilter < "${LOGIN_FILE}" > "${OUTPUT_FILE}"
|
|
||||||
post_comment
|
post_comment
|
||||||
wait "${LOGIN_PID}"
|
wait "${LOGIN_PID}"
|
||||||
exit 1
|
codex login status 2>&1 | ansifilter > "${COMMENT_FILE}"
|
||||||
|
post_comment
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export ISSUE_COMMENTS="$(
|
export ISSUE_COMMENTS="$(
|
||||||
@@ -38,6 +37,7 @@ FINAL_PROMPT="$(envsubst < "${ACTION_PATH}/scripts/prompt.md")"
|
|||||||
|
|
||||||
codex exec \
|
codex exec \
|
||||||
--dangerously-bypass-approvals-and-sandbox \
|
--dangerously-bypass-approvals-and-sandbox \
|
||||||
"${FINAL_PROMPT}" > "${OUTPUT_FILE}" 2>&1
|
--output-last-message "${COMMENT_FILE}" \
|
||||||
|
"${FINAL_PROMPT}"
|
||||||
|
|
||||||
post_comment
|
post_comment
|
||||||
|
|||||||
Reference in New Issue
Block a user