Skip to content

Commit 0565c1b

Browse files
committed
Revert "fix(review-gate): sanitize Idempotency-Key to API-allowed charset (#48)"
This reverts commit 98fed6e.
1 parent 98fed6e commit 0565c1b

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

.github/workflows/review-gate.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)