Issues and pull requests / Pull requests
Take a pull request from draft to merge
A pull request goes through several jobs before it lands: a draft, reviews, branch updates and the merge. Each job has a short page, so you read only the one that you need now.
3 min read
Pick the job
| You want to | Read |
|---|---|
| Open the pull request before the work is done, then ask for reviews | Open a draft and ask for reviews |
| Read the diff, comment on lines, then approve or ask for changes | Review a pull request |
| Merge the new commits of the base branch into your branch | Bring your branch up to date |
| Merge with a merge commit, a squash or a rebase | Pick how a pull request merges |
| Let the pull request merge by itself when its checks pass | Merge a pull request when its checks pass |
| Undo a merge that broke the base branch | Revert a merge that broke something |
| Bring your fork up to date with its parent | Sync your fork |
To see at once if a pull request can merge, and what changed since your last visit, see Read a pull request at a glance. When something fails, see When something on your pull request fails. It covers a failed check, a merge when ready that did not merge, and a part of the page that did not load.
More jobs
- To close an issue when your pull request merges, see Link the issues a pull request fixes.
- To fix the title, the description or a comment, see Edit the title, the description and comments.
- To change several members of a monorepo in one pull request, see Change several members in one pull request.
- In a stack, the merge button of a pull request also lands the pull requests below it, from the bottom. See Review and merge a stack of pull requests.
- To see which open pull requests are easy to merge or change the most, see Find the pull requests to handle first.
See your pull requests in a terminal
src pr status shows three lists:
- The pull request of your current branch.
- The open pull requests that you created.
- The pull requests that wait for your review.
The work that stops at the merge or the close
You merged or closed the pull request, but its CI and its agents still run. Nobody reads that work now, and you pay for it. The forge stops it for you.
A few seconds after the merge or the close, the forge cancels the work on the pull request that still runs:
- Its CI runs, hidden runs too.
- Its factory runs. See Stop a run.
- Its agent jobs, the ones that
src agent-task listshows.
Each one ends cancelled, with the reason The pull request was merged. or The pull request was closed.
- The CI run that the merge starts on the base branch keeps running, because it is a push run of the base branch.
- Agent sessions stay valid. To stop one, run
src agent revoke <session>. - If you reopen the pull request, the stopped runs do not start again. Push a commit, or run the workflow again.
- To keep the runs of one workflow going, set
cancelOnClose: falsein that workflow. See Runs of a closed pull request.
From an agent or a script
An agent or a script does each job over REST or MCP, with the same rules. Each job page ends with its REST routes and MCP tools. Use the REST API has the other routes.