Link GitHub pull requests into a stack
github_stack_linkBuild a native stack of open pull requests bottom-to-top or add new ones on top of an existing stack, ensuring each PR’s base branch matches the head branch below it.
Instructions
Make a native stack of open pull requests of one repository, listed bottom to top, or put more of them on top of an existing stack. Each pull request's base branch must be the head branch of the one below it. It never changes a base or opens a pull request: github_pr_create and github_pr_edit do that, and a chain whose bases do not match is refused with the base to fix. An existing stack only grows on top: list its top pull request (or a longer run of its top, up to all of it) and then the new ones. It is idempotent: pull requests that are in the stack already change nothing and changed is false.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prs | Yes | The pull request numbers of the repository, bottom to top; at least 2 unless some are in a stack already, and at most 100. Each one's base branch is the head branch of the one before it. | |
| repo | No | owner/name; defaults to the working tree's repository (its origin). Used for a bare number. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | Yes | ||
| added | Yes | The pull requests this call put into the stack, bottom to top. | |
| stack | Yes | The stack as GitHub holds it after the call, its pull requests bottom to top. | |
| changed | Yes | False when the pull requests were in the stack already and nothing was sent. | |
| created | Yes | Whether this call made the stack. | |
| foreign | Yes |