authorgravatar for saiansh2525@gmail.comYash Singh <saiansh2525@gmail.com> 2026-10-13 10:07:31-05:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-10-13 10:07:31-05:00
log42160f2925daa3c0d4ef2b95f68a87858972e6a3
tree7491703704556bdce979fd6cbea69d67edec9f84
parenta47decf230ac0562fc5f77ea88d92efc5eb61530
signature Signed by PGP key B5690EEEBB952194

fix(ci): retry Cursor webhook HTTP 400s on main (#19077)


1 files changed, 20 insertions(+), 6 deletions(-)

.github/workflows/cursor-hygiene-webhook.yml+20-6
......@@ -28,9 +28,23 @@ jobs:
2828 echo "Missing CURSOR_T3CODE_WEBHOOK_URL or CURSOR_T3CODE_WEBHOOK_AUTH — skipping."
2929 exit 0
3030 fi
31 curl -fsS --max-time 60 -X POST "$URL" \
32 -H "Authorization: $AUTH" \
33 -H "Content-Type: application/json" \
34 -H "X-GitHub-Event: ${{ github.event_name }}" \
35 -H "X-GitHub-Delivery: ${{ github.run_id }}-${{ github.run_attempt }}" \
36 --data-binary @"${{ github.event_path }}"
31 for attempt in 1 2 3; do
32 curl_status=0
33 http_status=$(curl -fsS --max-time 60 -X POST "$URL" \
34 --output /dev/null --write-out '%{http_code}' \
35 -H "Authorization: $AUTH" \
36 -H "Content-Type: application/json" \
37 -H "X-GitHub-Event: ${{ github.event_name }}" \
38 -H "X-GitHub-Delivery: ${{ github.run_id }}-${{ github.run_attempt }}" \
39 --data-binary @"${{ github.event_path }}") || curl_status=$?
40 if [ "$curl_status" -eq 0 ]; then
41 exit 0
42 fi
43 if [ "$GITHUB_REF" != "refs/heads/main" ] || \
44 [ "$curl_status" -ne 22 ] || [ "$http_status" != "400" ] || \
45 [ "$attempt" -eq 3 ]; then
46 exit "$curl_status"
47 fi
48 echo "Cursor webhook returned HTTP 400; retrying in 5 seconds ($attempt/2)."
49 sleep 5
50 done