> ## Documentation Index
> Fetch the complete documentation index at: https://ona.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Pull request triggers

> Trigger Automations from pull request events

Pull request triggers run Automations when PR events occur: code changes, reviews, merges. Use them for automated code review, security scanning, documentation updates, and compliance checks. They support **GitHub.com** through the GitHub App, and **GitLab** and **Bitbucket Cloud** through webhooks. Use a [service account](/ona/organizations/service-accounts) to separate Automation activity from human work.

## Configuration

<img src="https://mintcdn.com/gitpod-13c83c2b/xk3kxfJmgKP2B21t/images/automations/edit-trigger-pullrequest.png?fit=max&auto=format&n=xk3kxfJmgKP2B21t&q=85&s=eabfce39bccc51e6de9e21a2e72be2ee" alt="Pull request trigger configuration" width="1298" height="1462" data-path="images/automations/edit-trigger-pullrequest.png" />

### Event source

Pull request triggers need an event source that delivers PR events from your Git provider to Ona. There are two options:

| Source                                           | When to use                                                                                                                                                           |
| ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **[GitHub](/ona/integrations/configure-github)** | You use GitHub.com and have the [GitHub integration](/ona/integrations/configure-github) enabled. No extra setup is required. Ona receives PR events through the App. |
| **[Webhook](/ona/automations/webhooks)**         | You use GitLab or Bitbucket Cloud, or you prefer not to enable the GitHub integration. You create a webhook in Ona and register it in your Git provider.              |

#### GitHub

If your organization has the [GitHub integration](/ona/integrations/configure-github) enabled, select **GitHub** as the event source. Ona receives PR events directly through the App.

When your Ona organization connects more than one GitHub organization, each event source includes the GitHub organization name, such as `github.com/acme`. Select the organization that owns the repositories this Automation should monitor.

#### Webhook

If your organization has [webhooks](/ona/automations/webhooks) configured, a dropdown appears instead, letting you select an existing webhook or configure a new one.

### Runs on

* **Projects** (recommended): select projects. The Automation monitors all repositories within them.
* **Repositories**: use a search query to filter specific repositories.

### Triggers on PR

| Event            | When it fires                |
| ---------------- | ---------------------------- |
| Opened           | New PR created               |
| Updated          | New commits pushed           |
| Ready for review | Draft marked ready           |
| Review requested | Reviewer assigned for review |
| Approved         | Reviewer approves            |
| Merged           | PR merged                    |
| Closed           | PR closed without merge      |

**Common combinations:** Opened + Updated (check every change), Ready for review (analysis before human review), Approved (final validation)

## Next steps

* [GitHub](/ona/integrations/configure-github): enable the GitHub integration for webhook-free PR triggers
* [Webhooks](/ona/automations/webhooks): create and manage webhook endpoints
* [Run an Automation](/ona/automations/running-automations)
* [Manual triggers](/ona/automations/triggers/manual)
* [Time-based triggers](/ona/automations/triggers/timebased)
