Skip to main content

GitHub Webhooks

warning

GitHub event integration is currently in Beta. APIs and behavior may change in future releases.

GitHub event integrations receive webhook callbacks from GitHub and trigger handler functions as repository events occur. Use them to automate CI/CD workflows, sync issue trackers, enforce code review policies, and react to repository activity in real time.

Creating a GitHub Events service

  1. Click + Add Artifact in the canvas or click + next to Entry Points in the sidebar.

  2. In the Artifacts panel, select GitHub under Event Integration.

  3. In the creation form, fill in the following fields:

    GitHub Event Integration creation formGitHub Event Integration creation form
    FieldDescriptionDefault
    Event ChannelThe type of GitHub event to listen for. Select a service type from the dropdown (for example, IssuesService, PullRequestService). See Event channels for all options.Required
    Webhook SecretSecret used to validate incoming GitHub webhook requests. Configure the same value in your GitHub repository webhook settings.
    Webhook Listener PortThe port on which the webhook listener accepts incoming HTTP requests.8090

    Expand Advanced Configurations to set the listener name.

    FieldDescriptionDefault
    Listener NameIdentifier for the listener created with this service.githubListener
  4. Click Create.

  5. WSO2 Integrator opens the service in the Service Designer. The canvas shows the attached listener pill, the active event channel pill, and the Event Handlers section with all handlers for the selected channel pre-added.

    Service Designer showing the GitHub Event Integration canvasService Designer showing the GitHub Event Integration canvas

    All event handlers for the selected channel are added automatically. Click any handler to open it in the flow diagram view and implement the logic.

Service and listener configuration

In the Service Designer, click the Configure icon in the header to open the GitHub Event Integration Configuration panel.

GitHub Event Integration Configuration panelGitHub Event Integration Configuration panel

The configuration panel has two sections. The top section configures the service and the bottom section configures the attached listener.

Service configuration:

FieldDescription
Event ChannelThe GitHub event channel this service handles. Select from the available service types.

Listener configuration (under Configuration for githubListener):

FieldDescriptionDefault
NameIdentifier for the listener.githubListener
Listener ConfigWebhook validation configuration. Accepts a ListenerConfig record expression with a webhookSecret field.{ webhookSecret: "" }
Listen OnPort on which the listener accepts incoming webhook requests.8090

Click + Attach Listener to attach an additional listener to the same service.

Click Save Changes to apply updates.

Event channels

Each event channel maps to a specific GitHub webhook event type. Select the channel that matches the repository activity your integration needs to respond to.

ChannelGitHub eventDescription
IssuesServiceissuesIssues opened, closed, reopened, assigned, labeled, and more
IssueCommentServiceissue_commentComments created, edited, or deleted on issues and pull requests
PullRequestServicepull_requestPull requests opened, closed, merged, reviewed, and updated
PullRequestReviewServicepull_request_reviewPull request reviews submitted, dismissed, or edited
PullRequestReviewCommentServicepull_request_review_commentComments on pull request review diffs created, edited, or deleted
ReleaseServicereleaseReleases published, unpublished, created, edited, or deleted
LabelServicelabelLabels created, edited, or deleted
MilestoneServicemilestoneMilestones created, closed, opened, edited, or deleted
PushServicepushCommits pushed to a branch or tag
ProjectCardServiceproject_cardProject board cards created, edited, moved, or deleted

Event handlers

When a GitHub Events service is created, WSO2 Integrator adds all handlers for the selected channel automatically. Click any handler in the Service Designer to open the flow diagram view and implement the processing logic.

IssuesService handlers

HandlerTriggered whenPayload type
onOpenedA new issue is openedgithub:IssuesEvent
onClosedAn issue is closedgithub:IssuesEvent
onReopenedA closed issue is reopenedgithub:IssuesEvent
onAssignedA user is assigned to an issuegithub:IssuesEvent
onUnassignedA user is unassigned from an issuegithub:IssuesEvent
onLabeledA label is added to an issuegithub:IssuesEvent
onUnlabeledA label is removed from an issuegithub:IssuesEvent

PullRequestService handlers

HandlerTriggered whenPayload type
onOpenedA pull request is openedgithub:PullRequestEvent
onClosedA pull request is closed or mergedgithub:PullRequestEvent
onReopenedA closed pull request is reopenedgithub:PullRequestEvent
onAssignedA user is assigned to a pull requestgithub:PullRequestEvent
onUnassignedA user is unassigned from a pull requestgithub:PullRequestEvent
onLabeledA label is addedgithub:PullRequestEvent
onUnlabeledA label is removedgithub:PullRequestEvent
onEditedA pull request title, body, or base branch is editedgithub:PullRequestEvent
onReviewRequestedA review is requestedgithub:PullRequestEvent
onReviewRequestRemovedA review request is removedgithub:PullRequestEvent

IssueCommentService handlers

HandlerTriggered whenPayload type
onCreatedA comment is added to an issue or pull requestgithub:IssueCommentEvent
onEditedAn existing comment is editedgithub:IssueCommentEvent
onDeletedA comment is deletedgithub:IssueCommentEvent

PullRequestReviewService handlers

HandlerTriggered whenPayload type
onSubmittedA pull request review is submittedgithub:PullRequestReviewEvent
onDismissedA pull request review is dismissedgithub:PullRequestReviewEvent
onEditedA pull request review body is editedgithub:PullRequestReviewEvent

PullRequestReviewCommentService handlers

HandlerTriggered whenPayload type
onCreatedA comment is added to a pull request diffgithub:PullRequestReviewCommentEvent
onEditedA comment on a pull request diff is editedgithub:PullRequestReviewCommentEvent
onDeletedA comment on a pull request diff is deletedgithub:PullRequestReviewCommentEvent

ReleaseService handlers

HandlerTriggered whenPayload type
onPublishedA release is publishedgithub:ReleaseEvent
onUnpublishedA release is unpublishedgithub:ReleaseEvent
onCreatedA release draft is createdgithub:ReleaseEvent
onEditedA release is editedgithub:ReleaseEvent
onDeletedA release is deletedgithub:ReleaseEvent
onPreReleasedA release is marked as a pre-releasegithub:ReleaseEvent
onReleasedA pre-release is promoted to a full releasegithub:ReleaseEvent

LabelService handlers

HandlerTriggered whenPayload type
onCreatedA label is created in the repositorygithub:LabelEvent
onEditedA label name or color is changedgithub:LabelEvent
onDeletedA label is deletedgithub:LabelEvent

MilestoneService handlers

HandlerTriggered whenPayload type
onCreatedA milestone is createdgithub:MilestoneEvent
onOpenedA closed milestone is reopenedgithub:MilestoneEvent
onClosedA milestone is closedgithub:MilestoneEvent
onEditedA milestone title or description is editedgithub:MilestoneEvent
onDeletedA milestone is deletedgithub:MilestoneEvent

PushService handlers

HandlerTriggered whenPayload type
onPushCommits are pushed to a branch or a tag is created or deletedgithub:PushEvent

ProjectCardService handlers

HandlerTriggered whenPayload type
onCreatedA card is added to a project boardgithub:ProjectCardEvent
onEditedA card note is editedgithub:ProjectCardEvent
onMovedA card is moved to a different columngithub:ProjectCardEvent
onConvertedA card note is converted to an issuegithub:ProjectCardEvent
onDeletedA card is deleted from a project boardgithub:ProjectCardEvent

Error handling

If an event handler returns an error, the GitHub listener logs the error and continues processing subsequent events. Use do/on fail inside each handler to catch and recover from expected failures without propagating them to the listener.

Add an Error Handler block inside the handler flow to define recovery logic. Errors that escape the handler are caught by the listener and logged automatically.

What's next