Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

circleci-webhooks

БесплатноЗапускает вложенные скриптыНе проверен

Receive and verify CircleCI outbound webhooks. Use when setting up a CircleCI webhook handler, debugging `circleci-signature` verification, or handling the…

hookdeckот hookdeck★ 104 звезды на GitHub

Об этом скилле

CircleCI Webhooks

CircleCI (circleci.com) is a CI/CD platform. Its outbound webhooks POST JSON to your endpoint when a workflow or a job reaches a terminal state.

Not Circle. Circle (circle.com) is the USDC / Circle Payments Network / Circle Mint payments company. It signs with ECDSA and an X-Circle-Signature header. CircleCI signs with HMAC-SHA256 and a circleci-signature header. Two unrelated companies, two entirely different schemes — never mix their headers or events.

Not CircleCI custom webhooks. Those go the opposite direction: a third party POSTs to CircleCI to trigger a pipeline (docs). This skill is about CircleCI POSTing to you.

The signing secret is not your CircleCI API token. Circle-Token authenticates you calling CircleCI's API. The webhook "Secret token" (API field signing-secret) verifies CircleCI calling you.

When to Use This Skill

  • How do I receive CircleCI webhooks?
  • How do I verify a CircleCI webhook signature?
  • Why is my circleci-signature verification failing?
  • How do I handle workflow-completed or job-completed events?
  • How do I get the branch and commit SHA out of a CircleCI webhook payload?
  • How do I deduplicate CircleCI webhook deliveries?
  • Does CircleCI send a challenge/handshake when I add a webhook endpoint?

Verification (core)

CircleCI signs the raw request body bytes only — no timestamp, no delivery id, no prefix, no delimiter — with HMAC-SHA256 keyed on the webhook's Secret token used as UTF-8 bytes directly (no base64 decode). The digest is lowercase hex (64 chars) and arrives in circleci-signature as a comma-separated list of <version>=<signature> pairs. CircleCI's docs: "Only check the latest signature type to prevent downgrade attacks." Today v1 is the latest and only version, so take the v1 entry, ignore everything else, and reject if there is no v1 entry — never fall back to another version.

const crypto = require('crypto');

function verifyCircleCISignature(rawBody, signatureHeader, secret) {
  if (!signatureHeader || !secret) return false;               // fail closed

  // Comma-separated `<version>=<signature>`; split each pair on the FIRST `=`.
  let v1 = null;
  for (const pair of String(signatureHeader).split(',')) {
    const eq = pair.indexOf('=');
    if (eq === -1) continue;                                   // malformed pair
    if (pair.slice(0, eq).trim() === 'v1') { v1 = pair.slice(eq + 1).trim(); break; }
  }
  if (!v1) return false;    // no v1 entry -> reject; do NOT try v2/v3

  const expected = crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
  const a = Buffer.from(v1, 'utf8'), b = Buffer.from(expected, 'utf8');
  return a.length === b.length && crypto.timingSafeEqual(a, b);  // length guard first
}
import hmac, hashlib

def verify_circleci_signature(raw_body: bytes, signature_header: str, secret: str) -> bool:
    if not signature_header or not secret:          # fail closed
        return False
    v1 = None
    for pair in signature_header.split(","):
        version, sep, sig = pair.strip().partition("=")   # split on the FIRST '='
        if sep and version.strip() == "v1":
            v1 = sig.strip()
            break
    if not v1:                                      # no v1 entry -> reject
        return False
    expected = hmac.new(secret.encode("utf-8"), raw_body, hashlib.sha256).hexdigest()
    # compare BYTES: str input raises TypeError on a non-ASCII (hostile) header
    return hmac.compare_digest(v1.encode("utf-8"), expected.encode("utf-8"))

For complete handlers with tests, see examples/express/, examples/nextjs/, examples/fastapi/.

No SDK exists

CircleCI publishes no SDK helper for webhook verification. The docs give a plain hmac.new(bytes(secret, 'utf-8'), bytes(body, 'utf-8'), 'sha256').hexdigest() Python sample and nothing more. Manual HMAC is the only path — do not install an npm/pip package that claims to do this.

Known-answer test vectors

Straight from CircleCI's validation guide, all verified locally:

Body Secret v1 signature
hello world secret 734cc62f32841568f45715aeb9f4d7891324e6d948e4c6c60c0621cdac48623a
lalala another-secret daa220016c8f29a8b214fbfc3671aeec2145cfb1e6790184ffb38b6d0425fa00
an-important-request-payload hunter123 9be2242094a9a8c00c64306f382a7f9d691de910b4a266f67bd314ef18ac49fa
foo secret 773ba44693c7553d6ee20f61ea5d2757a9a4f4a44d2841ae4e95b52e4cd62db4

Gotchas That Actually Bite

There is no timestamp and no replay window. CircleCI's scheme signs the body alone. There is no circleci-timestamp header and

Полный SKILL.md на GitHub

Установить circleci-webhooks в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

TODO.mdexamples/express/.env.exampleexamples/express/README.mdexamples/express/package.jsonexamples/express/src/index.jsexamples/fastapi/.env.exampleexamples/fastapi/README.mdexamples/fastapi/main.pyexamples/fastapi/requirements.txtexamples/fastapi/test_webhook.pyexamples/nextjs/.env.exampleexamples/nextjs/README.mdexamples/nextjs/app/webhooks/circleci/route.tsexamples/nextjs/package.jsonexamples/nextjs/tsconfig.jsonexamples/nextjs/vitest.config.tsreferences/overview.mdreferences/setup.mdreferences/verification.md

FAQ

Что делает скилл circleci-webhooks?

Receive and verify CircleCI outbound webhooks. Use when setting up a CircleCI webhook handler, debugging `circleci-signature` verification, or handling the `workflow-completed` and `job-completed` events CircleCI sends when a workflow or job reaches a terminal state. CircleCI signs the raw body with HMAC-SHA256 and sends a hex digest in a comma-separated versioned list (`v1=<hex>`) — only the latest version (`v1`) should ever be checked. Not Circle (circle.com, USDC/Circle Mint, ECDSA `X-Circle-Signature`) — unrelated company. Not CircleCI custom webhooks, which are inbound pipeline triggers going the other direction.

Как установить скилл circleci-webhooks?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл circleci-webhooks запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить circleci-webhooks с