#!/usr/bin/env bash # Deterministic Gitea Markdown renderer stub for check.sh contract tests. set -euo pipefail connect_timeout=0 total_timeout=0 url="" while [ "$#" -gt 0 ]; do case "$1" in --connect-timeout) [ "${2:-}" = "5" ] || exit 2 connect_timeout=1 shift 2 ;; --max-time) [ "${2:-}" = "15" ] || exit 2 total_timeout=1 shift 2 ;; --header|--data-binary) shift 2 ;; http*) url="$1" shift ;; *) shift ;; esac done [ "${connect_timeout}" -eq 1 ] && [ "${total_timeout}" -eq 1 ] || exit 2 if [[ "${url}" == */api/v1/repos/action/check-naming/pulls/1 ]]; then if [ -n "${TEST_PR_BODY_FILE:-}" ]; then jq -Rs '{body: .}' < "${TEST_PR_BODY_FILE}" else printf '%s' "${PR_BODY:-}" | jq -Rs '{body: .}' fi exit 0 fi BODY=$(jq -r '.Text') if printf '%s\n' "${BODY}" | grep -Fq '[[stall-renderer]]'; then exit 28 fi if printf '%s\n' "${BODY}" | grep -Fq '