Git Provider Webhook Payload Normalizer to One Event Schema avatar

Git Provider Webhook Payload Normalizer to One Event Schema

Pricing

from $5.00 / 1,000 actor starts

Go to Apify Store
Git Provider Webhook Payload Normalizer to One Event Schema

Git Provider Webhook Payload Normalizer to One Event Schema

Convert GitHub, GitLab, and Bitbucket webhook payloads into one stable event schema.

Pricing

from $5.00 / 1,000 actor starts

Rating

0.0

(0)

Developer

kingii98

kingii98

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a month ago

Last modified

Categories

Security

Limited permissions

Share

Git Provider Webhook Payload Normalizer

This Actor converts raw GitHub, GitLab, and Bitbucket webhook payloads into one event schema. It makes no network calls. The transform is deterministic.

Input

payloads is an array of up to 500 items. Each item has these keys:

  • headers: the provider event headers. The Actor reads X-GitHub-Event, X-Gitlab-Event, or X-Event-Key. Header names are not case sensitive.
  • body: the payload as an object or as a JSON string. The maximum size is 1 MB.

An empty input runs the Actor on three built-in sample payloads.

Output

The Actor writes one dataset row for each payload that it normalizes. Each row has:

  • schemaVersion, provider, providerEventType, eventType, action
  • repository (id, name, fullName, url)
  • actor (id, login)
  • pullRequest (id, number, title, url, state), or null if the event is not a pull request event
  • ref and commits (sha, message, url, timestamp)
  • timestamps.eventAt
  • missingFields: the list of schema fields that the source payload did not contain
  • sourceIndex: the position of the payload in the input

eventType is push, tag_push, pull_request, or unknown. The original provider event name stays in providerEventType.

A payload that does not parse goes to the key-value store record REJECTED. This record is a list of {index, reason} objects. Reasons include: item is not an object, headers are not an object, no provider header, body is not valid JSON, body is not a JSON object, payload too large, and batch limit exceeded. Payloads after the 500th are rejected.

A rejected payload is a result, not an error. The run still succeeds. The status message gives the counts.

Pay-per-event pricing

EventUnitCharged
actor-startOne run startedOne time for each run
payload-normalizedOne payload normalizedOne time with count equal to the number of dataset rows

The Actor does not charge for rejected payloads.

Development

uv run pytest
uv run ruff check .