# GitHub Changes Integration Guide | PagerDuty

Send GitHub pull request and commit events to PagerDuty as Recent Changes, giving responders context during incident triage.

## GitHub Changes + PagerDuty Benefits

- Send notification-free events from GitHub or GitHub Enterprise to PagerDuty services regarding important changes, such as new pull requests and commits, to provide context for PagerDuty users. 
- Users may review change events within a PagerDuty service’s Recent Activity timeline during incident triage or hypercare. They can also see recent changes on the service’s incidents, and navigate across all changes in a comprehensive list of Recent Changes across all services.

## Requirements

> **AIOps / Signal Intelligence Feature:** This feature is included with the [PagerDuty AIOps](/ai-automation/aiops/overview) add-on, or included as Signal Intelligence in PD Reliability Platform plans. To sign up for a trial of PagerDuty AIOps features, read [PagerDuty AIOps Trials](/ai-automation/aiops/overview#pagerduty-aiops-trials).

> **AIOps Service Configuration:** Your service configuration must have AIOps enabled to use this feature. AIOps Service Configuration is in Limited General Availability — see [Configurable Service Settings](/incident-management/services/configurable-service-settings#manage-aiops) for more information and enablement steps.

- **In PagerDuty**: This integration requires a [Manager base role](/account-admin/advanced-permissions#base-roles) or higher to configure.

- **In GitHub**: This integration requires an Admin role to configure.

## How it Works

- When a GitHub pull request is closed and the branch is merged, a webhook will be sent to the endpoint of the integrated PagerDuty service. 
- These events will be viewable as [Recent Changes](/ai-automation/aiops/recent-changes) in the service’s Recent Changes timeline on incidents associated with that service, and in a global list of all change events.

## Integration Walkthrough

### In PagerDuty

1. In the PagerDuty web application, navigate to **Services**  →  **Service Directory** and click the **name** of your preferred service.
2. Select the **Integrations** tab and click **Add an integration**. 
3. Search and select **GitHub**, then click **Add**.

![A screenshot of the PagerDuty UI showing how to select the Github integration type](/images/kb/f0d8e2a6d73f9b695e9d4274889502d4ab4a7cfab5b6e0511bb01198acc43380-select_GitHub.webp)

4. On the next screen, find **GitHub** in the list of integrations and click  to reveal the integration details.

![A screenshot of the PagerDuty UI showing how to reveal integration details](/images/kb/bb37edc626fb52fc3da61bd87624740b8346212f0e8549b10d78c8a026490442-integration_details.webp)
*Integration details*

5. In the section **Integration URL**, click  to copy the integration URL to your clipboard. It will be in the following format: `https://events.pagerduty.com/integration/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/change/enqueue`.
   - Keep the URL in a safe place, since you will use it in the [next section](#in-github).

> **Branch Tracking:** By default, the integration tracks the `main`/`master` branch. To edit this behavior, please refer to the section [Branch Tracking](#branch-tracking)

### In GitHub

6. Navigate to the GitHub repository where you would like to track changes, select the **Settings** tab, and then select **Webhooks**.
7. Click **Add webhook** on the right.
8. Paste the **Integration URL** that you generated in PagerDuty ([above](#in-pagerduty)) into the **Payload URL** field, and in the **Content type** dropdown select **application/x-www-form-urlencoded**.
9. Under **Which events would you like to trigger this webhook?** select **Let me select individual events**. Check the box next to **Pull requests** and uncheck the box next to **Pushes**.
10. Ensure that the **Active** checkbox is selected, enter any other preferred settings, and click **Add/Update webhook**. 

> **Push Events:** This integration also supports push events, but they will show less information in PagerDuty. The pull request event is recommended if you use GitHub's pull request functionality. Since selecting both pull request and push events may result in two change events for a single action, we recommend selecting just one or the other.

## Using the Integration

To test the integration, merge a pull request to the branch that you are tracking. If needed, you can temporarily change the branch you are tracking from `master` / `main` to another test branch using the [Branch Tracking](#branch-tracking) instructions below. In your PagerDuty account, navigate to the integrated service, click its **title** and you will see a change event in the **Recent Changes** table.

![A screenshot of the PagerDuty web app showing recent changes](/images/kb/8226713560eaa0a4a4aae109df36b3e85c575f0a13e3c571f576b5e5e4b8ac81-recent_changes.webp)
*Recent changes*

### Branch Tracking

By default, the integration tracks the `main`/`master` branch. If you would like to track a different branch, or track multiple branches:

1. Navigate to the service with the **GitHub** integration  →  select the **Integrations** tab  →  click  to the right of your **GitHub** integration.

![A screenshot of the PagerDuty UI showing how to edit an integration](/images/kb/b240825547bd035081dffe94053cb9c11655d50c9dbfbbe053cddcad91ba9541-edit_integration.webp)
*Edit integration*

2. Click **Edit Integration** on the right and enter the name of your preferred branch in the **branch** field. To track multiple branches, add a space between each branch’s name, for example: `feature-branch-1 feature-branch-2 feature-branch-3`.
3. Click **Save changes**.

### GitHub Actions

The GitHub Changes integration supports creating change events with [GitHub Actions](https://github.com/features/actions). To use this feature, follow the [Integration Walkthrough](#integration-walkthrough) above to complete configuration, and use the **Integration Key** with the [PagerDuty Change Events GitHub Action](https://github.com/marketplace/actions/pagerduty-change-events).

## FAQ

**Is it possible to modify change events using Event Orchestration?**

Not at this time, but we are interested to learn about what you would like to accomplish, please [contact our Support team](https://www.pagerduty.com/contact-us/#contact-support) with your use cases and feedback.

**Is it possible to send change events from multiple GitHub branches?**

Yes, you can add any number of integrations to a single technical service in PagerDuty, including multiple GitHub integrations.

**Are change events viewable in Slack or the PagerDuty mobile app?**

Not at this time, but we would like to hear your feedback. Please [contact our Support team](https://www.pagerduty.com/contact-us/#contact-support).

**Does the integration accept events other than push or pull request events?**

The integration only accepts push (`push`) and pull request (`pull_request`) events. The integration will not accept other event types, such as `ping` or `issues`.
