Forge Tools webhook.ingest

webhook.ingest write

scidex.forge.webhook.ingest

Ingest a Forgejo webhook delivery into the substrate event log. Idempotent: duplicate delivery_ids return immediately with is_duplicate=True. Validates event_type against the known Forgejo event type set.

HTTP: POST /api/scidex/forge/webhook/ingest

Invoke

Calls scidex.tool.invoke on the substrate with this tool name. Edit the JSON below — it must match the input schema. The substrate runs the tool, records the call in substrate_tool_calls, and returns a structured envelope.

Sign in to invoke this tool. Schema and curl snippet are visible to anyone.

Schemas

Input schema
{
  "properties": {
    "delivery_id": {
      "description": "Forgejo X-Gitea-Delivery header value (UUID).  Used as the idempotency key — duplicate deliveries are silently discarded.",
      "title": "Delivery Id",
      "type": "string"
    },
    "event_type": {
      "description": "Forgejo X-Gitea-Event header value: push, pull_request, issues, issue_comment, release, pull_request_review, etc.",
      "title": "Event Type",
      "type": "string"
    },
    "repo_url": {
      "description": "HTML URL of the Forgejo repository that sent this event.",
      "title": "Repo Url",
      "type": "string"
    },
    "payload": {
      "additionalProperties": true,
      "description": "Full Forgejo webhook JSON payload.",
      "title": "Payload",
      "type": "object"
    }
  },
  "required": [
    "delivery_id",
    "event_type",
    "repo_url",
    "payload"
  ],
  "title": "ForgeWebhookIngestIn",
  "type": "object"
}
Output schema
{
  "properties": {
    "delivery_id": {
      "description": "The delivery ID that was processed.",
      "title": "Delivery Id",
      "type": "string"
    },
    "is_duplicate": {
      "description": "True when this delivery_id was already ingested (idempotent replay).",
      "title": "Is Duplicate",
      "type": "boolean"
    },
    "artifact_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Resolved substrate artifact_id, if the repo is registered.",
      "title": "Artifact Id"
    },
    "event_queued": {
      "description": "True when a forgejo_webhook.received event was emitted.",
      "title": "Event Queued",
      "type": "boolean"
    }
  },
  "required": [
    "delivery_id",
    "is_duplicate",
    "event_queued"
  ],
  "title": "ForgeWebhookIngestOut",
  "type": "object"
}

curl snippet

Replace $SCIDEX_JWT with a valid bearer token. Read verbs are usually accessible without auth in dev; production requires a JWT.

curl -sS -X POST '/api/scidex/forge/webhook/ingest' \
  -H 'authorization: Bearer $SCIDEX_JWT' \
  -H 'content-type: application/json' \
  -d '{
  "delivery_id": "",
  "event_type": "",
  "repo_url": "",
  "payload": {}
}'

Discussion

Posting anonymously. Sign in for attribution.

No comments yet — be the first.