CHAT_OUTPUT_BEGIN
COMMAND_ID=RUNTIME-RECEIVER-BLOCK-029
STATUS=OK
RC=0
HOST=pve01
MODE=read-only
COMPONENT=gitea-runtime
REFERENCE_REGISTER_CHECK=OK
REFERENCE_SHA256=f6f7749fda946015116cdbbd754c7e7f20356b4a6cf4df330a1b0b8fdf59cbb2
ERROR_REGISTER_CHECK=OK
ERROR_REGISTER_SHA256=ab8308549db90d235b591af0581580c3c7ba1b287b129cc6111c2eef0a0f9ecc
COMMAND_SHA256=619f047ae18b1005d147fefbb1bbaef64c1eb4d040f35abc3fdc8510ed9d3e9f
DUPLICATE_FAILED_COMMAND_BLOCKED=false
EXECUTION_STARTED=true
CHANGES_MADE=false
SANITIZED=yes
SECRETS_INCLUDED=no
PRIVATE_ADDRESSES_INCLUDED=no
RAW_EVIDENCE_SHA256=b29d337315730363cdb092e9e5b50d05b750fa2e2d7d29796274faba627a7fd2
SANITIZED_OUTPUT_SHA256=b29d337315730363cdb092e9e5b50d05b750fa2e2d7d29796274faba627a7fd2
OUTPUT_BEGIN
            --quiet \
            -m "runtime: publish ${COMMAND_ID}"
fi

COMMIT="$(git rev-parse HEAD)"
GIT_ASKPASS=/data/gitea/runtime-auth/askpass GIT_TERMINAL_PROMPT=0 git push --quiet http://127.0.0.1:3000/homelab-admin/homelab-public-context.git HEAD:refs/heads/assistant-runtime
GIT_ASKPASS=/data/gitea/runtime-auth/askpass GIT_TERMINAL_PROMPT=0 git push --quiet http://127.0.0.1:3000/homelab-admin/homelab-public-context.git HEAD:assistant-runtime

git --git-dir="$BARE" \
    fetch \
    --quiet \
    "$WORK" \
    refs/heads/assistant-runtime

OLD="$(
    git --git-dir="$BARE" \
        rev-parse refs/heads/assistant-runtime \
        2>/dev/null ||
    true
)"

if [ -n "$OLD" ]
then
    git --git-dir="$BARE" \
        update-ref \
        refs/heads/assistant-runtime \
        "$COMMIT" \
        "$OLD"
else
    git --git-dir="$BARE" \
        update-ref \
        refs/heads/assistant-runtime \
        "$COMMIT"
fi

rm -rf "$WORK"

printf "%s\n" "$COMMIT"
'
)"


OUTPUT_END
CHAT_OUTPUT_END
