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 Webhook 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.

    Github Service Designer View

    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.

Listener configuration

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

Github Connection Configure View

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

Each handler receives a github:IssuesEvent payload.

HandlerTriggered when
onOpenedA new issue is opened
onClosedAn issue is closed
onReopenedA closed issue is reopened
onAssignedA user is assigned to an issue
onUnassignedA user is unassigned from an issue
onLabeledA label is added to an issue
onUnlabeledA label is removed from an issue

PullRequestService handlers

Each handler receives a github:PullRequestEvent payload.

HandlerTriggered when
onOpenedA pull request is opened
onClosedA pull request is closed or merged
onReopenedA closed pull request is reopened
onAssignedA user is assigned to a pull request
onUnassignedA user is unassigned from a pull request
onLabeledA label is added
onUnlabeledA label is removed
onEditedA pull request title, body, or base branch is edited
onReviewRequestedA review is requested
onReviewRequestRemovedA review request is removed

IssueCommentService handlers

Each handler receives a github:IssueCommentEvent payload.

HandlerTriggered when
onCreatedA comment is added to an issue or pull request
onEditedAn existing comment is edited
onDeletedA comment is deleted

PullRequestReviewService handlers

Each handler receives a github:PullRequestReviewEvent payload.

HandlerTriggered when
onSubmittedA pull request review is submitted
onDismissedA pull request review is dismissed
onEditedA pull request review body is edited

PullRequestReviewCommentService handlers

Each handler receives a github:PullRequestReviewCommentEvent payload.

HandlerTriggered when
onCreatedA comment is added to a pull request diff
onEditedA comment on a pull request diff is edited
onDeletedA comment on a pull request diff is deleted

ReleaseService handlers

Each handler receives a github:ReleaseEvent payload.

HandlerTriggered when
onPublishedA release is published
onUnpublishedA release is unpublished
onCreatedA release draft is created
onEditedA release is edited
onDeletedA release is deleted
onPreReleasedA release is marked as a pre-release
onReleasedA pre-release is promoted to a full release

LabelService handlers

Each handler receives a github:LabelEvent payload.

HandlerTriggered when
onCreatedA label is created in the repository
onEditedA label name or color is changed
onDeletedA label is deleted

MilestoneService handlers

Each handler receives a github:MilestoneEvent payload.

HandlerTriggered when
onCreatedA milestone is created
onOpenedA closed milestone is reopened
onClosedA milestone is closed
onEditedA milestone title or description is edited
onDeletedA milestone is deleted

PushService handlers

The handler receives a github:PushEvent payload.

HandlerTriggered when
onPushCommits are pushed to a branch or a tag is created or deleted

ProjectCardService handlers

Each handler receives a github:ProjectCardEvent payload.

HandlerTriggered when
onCreatedA card is added to a project board
onEditedA card note is edited
onMovedA card is moved to a different column
onConvertedA card note is converted to an issue
onDeletedA card is deleted from a project board

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