Skip to main content

GitHubEvent

API Group: events.blanketops.dev

Version: v1alpha1

Scope: Namespaced


Description

GitHubEvent represents a normalized, provider-derived event created from a validated GitRepository webhook.

It converts external webhook payloads into structured internal delivery state.

GitHubEvent is not a raw webhook payload. It is a governed event object.

GitHubEvent is immutable once created — the controller writes status, never the spec.


Spec

FieldTypeRequiredDescription
repositorystringYesRepository the event originated from, as owner/name
eventTypestringYesProvider event type: push, pull_request, release, or manual
refstringNoGit ref the event applies to (e.g. refs/heads/main)
commitSHAstringNoCommit SHA at the head of the event
actorstringNoProvider login of the actor who caused the event
eventIdstringNoProvider-assigned delivery ID, used for idempotency and audit
occurredAtstringNoTimestamp the provider reports the event occurred at
webhookSecretRefstringNoName of the Secret holding the HMAC signing secret. Absent for manual dispatch

Only repository and eventType are enforced today — everything else is read if present and left empty otherwise. A real webhook delivery populates ref, commitSHA, and actor; a manual dispatch can omit them.

webhookSecretRef names a Secret materialized via ExternalSecret from /blanketops/github/webhook/secret — see Environment: Secrets & SecretStore. It isn't created directly, and unlike most secret references in this platform it's a plain name, not a {name, key} pair — the signing value's key within that Secret is a platform convention, not something you set here.


Status

FieldTypeDescription
phasestringLifecycle phase of the event
conditions[]ConditionStandard Kubernetes condition array
acceptedbooleanWhether the event passed signature verification and contract match
triggeredbooleanWhether the event triggered a Build
triggeredRefstringName of the Build CR triggered by this event, if any
reasonstringHuman-readable reason if not accepted or not triggered
processedAtstringTimestamp when event was evaluated

status.phase Values

ValueMeaning
PendingEvent recorded, not yet evaluated
ReadyEvent evaluated — see accepted/triggered for outcome
FailedEvaluation could not complete

Example

apiVersion: events.blanketops.dev/v1alpha1
kind: GitHubEvent
metadata:
name: for-kaniko-app-3f2c91d
namespace: dev
spec:
contract:
repository: example-org/for-kaniko-app
eventType: push
ref: refs/heads/main
commitSHA: 3f2c91d

That's the manual dispatch path — useful for local testing before a webhook is wired up, and you choose the namespace.

Real webhook deliveries land somewhere different. GitRepository provisions an Argo Events EventSource + Sensor pair in the platform's own argo-events namespace, not the GitRepository's namespace. When GitHub actually delivers a webhook, that Sensor is what creates the resulting GitHubEvent — and it creates it in argo-events, populating ref, commitSHA, and actor from the payload:

kubectl get githubevents.events.blanketops.dev -n argo-events

Not -n dev. This is easy to miss the first time — see [Next Steps: Try a Real Webhook](../../Getting Started/next-steps.md).

With signature verification wired up (relevant to the manual-dispatch path above; the Sensor's own trigger doesn't set this):

apiVersion: events.blanketops.dev/v1alpha1
kind: GitHubEvent
metadata:
name: for-kaniko-app-3f2c91d
namespace: dev
spec:
contract:
repository: example-org/for-kaniko-app
eventType: push
ref: refs/heads/main
commitSHA: 3f2c91d
webhookSecretRef: github-webhook-secret

github-webhook-secret here is materialized by the controller via ExternalSecret, sourced from /blanketops/github/webhook/secret in the environment's secret store — see Environment: Secrets & SecretStore. It isn't created directly.


Invariants

  • GitHubEvent is immutable once created — resubmit a new event rather than editing an existing one.
  • repository must match a repository.owner/repository.name pair from an existing GitRepository.
  • eventType must be one of the declared webhook events on the originating GitRepository.
  • Webhook-delivered GitHubEvents are created in the platform's argo-events namespace, not the originating GitRepository's namespace.