You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/pull-requests/get-started/about-stacked-prs.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,7 @@ You can merge your entire stack, a single pull request, or a portion of the stac
113
113
Stacks support merge commit, squash, and rebase merge methods, and they are merge-queue aware. The resulting commit history is the same as merging each pull request individually, starting from the bottom.
114
114
115
115
> [!NOTE]
116
-
> If you merge via the API and want to use stacked pull requests, you'll need to update to use the new merge API for stacks. See [AUTOTITLE](/rest/pulls/pulls?apiVersion=2026-03-10#merge-a-pull-request-asynchronously).
116
+
> If you merge via the API and want to use stacked pull requests, you'll need to use the asynchronous merge API for stacks. See [AUTOTITLE](/rest/pulls/pulls?apiVersion=2026-03-10#merge-a-pull-request-asynchronously).
Copy file name to clipboardExpand all lines: content/pull-requests/how-tos/merge-and-close-pull-requests/merging-stacked-pull-requests.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ The merge box for a stacked pull request shows the status of the entire stack, n
27
27
If the stack is not linear, for example, after changes were pushed to a lower branch or after the trunk moved ahead, a **Rebase stack** button will appear in the merge box and you'll need to rebase the stack before you can merge.
28
28
29
29
> [!NOTE]
30
-
> * If you merge via the API and want to use stacked pull requests, you'll need to update your code to use the new merge API for stacks. See [AUTOTITLE](/rest/pulls/pulls?apiVersion=2026-03-10#merge-a-pull-request-asynchronously).
30
+
> * If you merge via the API and want to use stacked pull requests, you'll need use the asynchronous merge API for stacks. See [AUTOTITLE](/rest/pulls/pulls?apiVersion=2026-03-10#merge-a-pull-request-asynchronously).
31
31
> * Auto-merge is not supported for stacked pull requests.
intro: 'Discover how to create, review, and merge pull requests, resolve merge conflicts, and collaborate effectively on {% data variables.product.github %} projects.'
12
+
intro: 'Discover how to create, review, and merge pull requests, resolve merge conflicts, and work with forks.'
{% data reusables.public-preview.public-preview %}
@@ -23,11 +26,21 @@ The REST API exposes stacked pull requests in two ways:
23
26
***The `stack` object on pull request resources.** When a pull request belongs to a stack, its REST resource includes a `stack` object. This lets you read the pull request's stack membership, including the stack's number and size and the pull request's position and base, directly from the pull request.
24
27
***The Stacks API.** A dedicated set of endpoints to list, read, create, extend, and dissolve stacks. This is the surface for creating and modifying stacks.
25
28
26
-
> [!NOTE]
27
-
> If you merge via the API and want to use stacked pull requests, you'll need to update your code to use the new merge API for stacks. See [AUTOTITLE](/rest/pulls/pulls?apiVersion=2026-03-10#merge-a-pull-request-asynchronously).
28
-
29
29
For endpoints, parameters, and schemas, see [AUTOTITLE](/rest/pulls/pulls).
30
30
31
+
> [!IMPORTANT]
32
+
> If you merge via the API and want to use stacked pull requests, you must use the new asynchronous merge API.
33
+
34
+
### Merge API
35
+
36
+
When you merge a stacked pull request via the API, you must use the asynchronous merge endpoint.
37
+
38
+
A stack cannot be merged with the legacy synchronous merge endpoints or mutations. When you merge a stacked pull request, every pull request in the stack up to and including the one you request is merged or queued to merge into the base branch. Merging a pull request stack may involve several pull requests that may take a few minutes to merge. Because of this, the merge runs in the background when you submit a merge request and then you can poll for the result.
39
+
40
+
Only the basic pull request state is checked when you submit an open PR. Branch protection and repository rules are evaluated later, when the merge actually runs, and a rule failure is reported as a failed result while polling. A stack merge request is atomic, meaning either the whole group of pull requests merges, or is added to the merge queue, or none of it is.
41
+
42
+
For details, see [AUTOTITLE](/rest/pulls/pulls?apiVersion=2026-03-10#merge-a-pull-request-asynchronously).
43
+
31
44
## GraphQL API
32
45
33
46
The GraphQL API exposes a pull request's stack membership through read-only `stack` and `stackEntry` fields on the `PullRequest` type. Use these fields to query the stack a pull request belongs to and its position within it.
@@ -36,6 +49,14 @@ The GraphQL API is read-only for stacks; there are no stack mutations. To create
36
49
37
50
For fields, objects, and schemas, see [AUTOTITLE](/graphql/reference/pulls#object-pullrequeststack).
38
51
52
+
## Webhooks
53
+
54
+
When a pull request belongs to a stack, {% data variables.product.github %} adds a `stack` property to the `pull_request` object in webhook event payloads. This lets apps and integrations inspect the stack's target branch, not just the direct parent branch of the pull request.
55
+
56
+
The `stack` object is included in the `pull_request` webhook payload for pull request lifecycle events that happen while the pull request is part of a stack.
57
+
58
+
See [AUTOTITLE](/webhooks/webhook-events-and-payloads?actionType=stacked#pull_request).
Copy file name to clipboardExpand all lines: content/pull-requests/tutorials/roll-out-stacked-prs.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,11 +67,11 @@ To sustain adoption, review any in-house tools, bots, or dashboards that create,
67
67
If your organization provides an internal CLI or other developer tooling, you can use the Stacks API to integrate stack creation and management into those existing tools instead of requiring developers to adopt `gh stack`.
68
68
69
69
> [!IMPORTANT]
70
-
> Merging a stacked pull request programmatically requires the asynchronous merge API, which supports both stacked and standalone pull requests. The legacy pull request merge endpoint can't merge a stack. If your organization merges pull requests programmatically, update that tooling to use the asynchronous merge API before rolling out stacked pull requests. See [AUTOTITLE](/rest/pulls/pulls?apiVersion=2026-03-10#merge-a-pull-request-asynchronously).
70
+
> Merging a stacked pull request requires the asynchronous merge API. The legacy pull request merge endpoints can't merge a stack. If your organization merges pull requests programmatically, for example, through in-house tooling or ChatOps bots, update that tooling to call the asynchronous merge API, which supports both stacked and regular pull requests, before rolling out stacked pull requests. See [AUTOTITLE](/rest/pulls/pulls?apiVersion=2026-03-10#merge-a-pull-request-asynchronously).
71
71
72
72
You may also want to track stack activity programmatically, for example, across dashboards, bots, or internal tooling.
73
73
74
-
***REST API**: Every pull request returned by the API includes a `stack` object when it belongs to a stack, showing the stack's number, size, the pull request's position within it, and the stack's base branch. A dedicated Stacks API (`GET /repos/{owner}/{repo}/stacks`) also lists every stack in a repository, or the specific stack containing a given pull request. See [AUTOTITLE](/pull-requests/reference/stacked-pull-requests-rest-and-graphql-apis).
74
+
***REST API**: Every pull request returned by the API includes a `stack` object when it belongs to a stack, showing the stack's number, size, the pull request's position within it, and the stack's base branch. A dedicated Stacks API (`GET /repos/{owner}/{repo}/stacks`) also lists every stack in a repository, or the specific stack containing a given pull request. See [AUTOTITLE](/pull-requests/reference/stacked-pull-requests-apis-and-webhooks).
75
75
***Webhooks**: The `pull_request` webhook payload includes the same `stack` object whenever a pull request belongs to a stack. A dedicated `stacked` action fires when a pull request is first added to a stack, so you can react the moment a stack forms.
76
76
77
77
In both cases, the `stack` field is `null` for standalone pull requests, so existing integrations that don't expect stacks continue to work unchanged.
0 commit comments