> For the complete documentation index, see [llms.txt](https://help.swarmia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.swarmia.com/settings/organization/configuring-deployments-in-swarmia/generate-deployments-from-merged-pull-requests.md).

# Generate deployments from merged pull requests

Looking to get started with [DORA metrics](/features/metrics/track-dora-metrics.md)? Tracking how often a team deploys and the quality of these deploys is often not a trivial task. It's difficult to get a perfect solution right away, and often it's better to aim for a solution as the first step.

PR merge based deployments are only supported if you directly merge to the selected deploy branch. If you have automation that initiates deploys without pull requests based on a single branch, then you need to use [GitHub checks](https://help.swarmia.com/generate-deployments-from-github-checks) or the [Deployments API](https://help.swarmia.com/sending-deployment-information-to-swarmia) to inform Swarmia about deployments.

We backfill deployment data for the past 90 days.

## Limitations

Using PR merges as the deployment source has the following limitations:

* [**Time to deploy**](/definitions/dora-metrics/time-to-deploy.md) **is not available**. This is because we only know when the PR was merged, but don't get any signal when it is in production. This means that the [change lead time](/definitions/dora-metrics/change-lead-time.md) will be equal to the [pull request cycle time](/features/metrics/pull-request-cycle-time.md).
* [**Automatic rollback detection**](/features/metrics/track-dora-metrics/automatic-change-failure-detection.md#rollback-detection) **is not available**. This is because we don't get the deployed version numbers from PR merges.

## Configuration

[**Deployments**](https://app.swarmia.com/metrics/deployments) can use Pull Request merges as the input data.

1. [**Start by creating an application**](https://app.swarmia.com/settings/deployments) and giving it a name
2. Select "**Pull request merge creates a deploy**" as the **Deployment source**.
3. Select repository
4. Select the branch (or branch prefix) that most accurately represents your production deployment events. You can give this environment a name, although we recommend "production".
5. *Optional:* Add more environments based on the branch name or prefix. This allows you to view deployments from different environments on the [Metrics → DORA → Deployments](https://app.swarmia.com/metrics/dora/deployments) page.
6. Confirm the amount of deployment data to be created, and **Save**.

<figure><img src="/files/ihS3VHNZaTj7ZwD0YxrF" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.swarmia.com/settings/organization/configuring-deployments-in-swarmia/generate-deployments-from-merged-pull-requests.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
