Authored-By: Codex (GPT-5) <noreply@openai.com>
This commit is contained in:
+25
-6
@@ -4,6 +4,7 @@ set -euo pipefail
|
||||
|
||||
connect_timeout=0
|
||||
total_timeout=0
|
||||
url=""
|
||||
while [ "$#" -gt 0 ]; do
|
||||
case "$1" in
|
||||
--connect-timeout)
|
||||
@@ -16,20 +17,38 @@ while [ "$#" -gt 0 ]; do
|
||||
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 printf '%s\n' "${PR_BODY}" | grep -Fq '[[stall-renderer]]'; then
|
||||
exit 28
|
||||
fi
|
||||
|
||||
if printf '%s\n' "${PR_BODY}" | grep -Fq '<!--'; then
|
||||
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
|
||||
|
||||
printf '%s\n' "${PR_BODY}" | awk '
|
||||
BODY=$(jq -r '.Text')
|
||||
|
||||
if printf '%s\n' "${BODY}" | grep -Fq '[[stall-renderer]]'; then
|
||||
exit 28
|
||||
fi
|
||||
|
||||
if printf '%s\n' "${BODY}" | grep -Fq '<!--'; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
printf '%s\n' "${BODY}" | awk '
|
||||
{
|
||||
line=$0
|
||||
lower=tolower(line)
|
||||
|
||||
Reference in New Issue
Block a user