All Products
Search
Document Center

EventBridge:Integrate GitHub

Last Updated:Sep 05, 2023

This topic describes how to use an HTTP event source to integrate GitHub with EventBridge.

Background information

GitHub is a version management tool. For a project that has multiple developers, you can use EventBridge to notify the developers of specific operations that are performed in the GitHub code repository of the project. This allows the developers to effectively follow the code changes and improves the collaboration efficiency.

Prerequisites

Procedure

Step 1: Create an event source for GitHub in EventBridge

Create an event source HTTP/HTTPS trigger in the EventBridge console. The following table describes the parameters. For more information, see Create a custom event source of the HTTP/HTTPS Events type.

  • Request Type: Select HTTP&HTTPS.

  • Request Method: Select a POST.

  • Security Configuration: Select Optional.

After the event source is created, you can find the custom event source in the event source list, and then click Details to view the configuration information. Internet request URL can be used as the webhook URL of the event source. pic-1

Step 2: Configure a webhook in GitHub

  1. Log on to GitHub and click a repository.

  2. Click the Settings tab. In the left-side navigation pane, click Webhooks.

  3. In the upper-right corner of the page that appears, click Add webhook, configure the parameters, and then click Add webhook. The following items describe the parameters:

    • Payload URL: Enter the Internet request URL that is generated in Step 1: Create an event source for GitHub in EventBridge.

    • Content type: Select application/json.

    • Which events would you like to trigger this webhook?: Select Just the push event.

    pic-2
  4. Perform operations in the local repository and push the changes to GitHub.

Step 3: Verify the result

  1. Log on to the EventBridge console.
  2. In the top navigation bar, select the region.
  3. In the left-side navigation pane, click Event Buses.
  4. In the left-side navigation pane, click Event Tracking to view and verify the obtained event information.