GitHub WebHook Integration
Collect GitHub events (via webhooks), transform them to cdevents.
- Github tracks all changes to repositories, issues, pull requests, releases, workflows, and more. And it notifies a webhook about these changes.
- cdviz-collector transforms these events to cdevents, and sends them to the database, listeners,...
| From event | CDEvents |
|---|---|
| package.published | artifact.published |
| release.published | artifact.published |
| create (branch) | branch.created |
| delete (branch) | branch.deleted |
| pull_request.opened | change.created |
| pull_request.closed | change.{merged, abandoned} |
| pull_request.* | change.updated |
| pull_request_review.submitted | change.reviewed |
| workflow_run.requested | pipelineRun.queued |
| workflow_run.in_progress | pipelineRun.started |
| workflow_run.completed | pipelineRun.finished |
| workflow_job.in_progress | taskRun.started |
| workflow_job.completed | taskRun.finished |
| issue.opened | ticket.created |
| issue.closed | ticket.closed |
| issue.* | ticket.updated |
Configuration
CDviz Side
Setting up cdviz-collector.toml to receive GitHub events involves defining a webhook source in the collector configuration file. Below is an example configuration snippet:
toml
# Remote transformers repository configuration
[remote.transformers-community]
type = "github://cdviz-dev/transformers-community"
[sources.github_webhook]
enabled = true
transformer_refs = ["github_events"]
[sources.github_webhook.extractor]
type = "webhook"
id = "000-github"
headers_to_keep = []
[sources.github_webhook.extractor.headers]
"x-hub-signature-256" = { type = "signature", signature_encoding = "hex", signature_on = "body", signature_prefix = "sha256="