File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -334,18 +334,12 @@ jobs:
334334 # openssl output is "(stdin)= <hex>" or "SHA2-256(stdin)= <hex>"; take last.
335335 SIG="$(printf '%s' "$POST_BODY" | openssl dgst -sha256 -hmac "$ABCA_WEBHOOK_SECRET" | awk '{print $NF}')"
336336
337- # The Task API validates Idempotency-Key against ^[a-zA-Z0-9_-]{1,128}$.
338- # $REPO carries a "/" (owner/repo), so map every disallowed char to "-"
339- # and cap at 128. Still per-(repo,PR,SHA) unique, which is all we need.
340- IDEMPOTENCY_KEY="$(printf 'review-%s-%s-%s' "$REPO" "$PR_NUMBER" "$HEAD_SHA" \
341- | tr -c 'a-zA-Z0-9_-' '-' | cut -c1-128)"
342-
343337 HTTP_CODE="$(curl -sS -o /tmp/abca-resp.txt -w '%{http_code}' \
344338 -X POST "${ABCA_TASK_API_URL%/}/webhooks/tasks" \
345339 -H 'Content-Type: application/json' \
346340 -H "X-Webhook-Id: $ABCA_WEBHOOK_ID" \
347341 -H "X-Webhook-Signature: sha256=$SIG" \
348- -H "Idempotency-Key: $IDEMPOTENCY_KEY " \
342+ -H "Idempotency-Key: review-$REPO-$PR_NUMBER-$HEAD_SHA " \
349343 --data-raw "$POST_BODY")"
350344
351345 if [[ "$HTTP_CODE" =~ ^2 ]]; then
You can’t perform that action at this time.
0 commit comments