Skip to main content

Creating and Updating Pull Requests in Bosun Workflows

Bosun workflows can integrate with your development process by automating the creation and updating of pull requests (PRs). This allows you to prepare for work, track progress, and finalize changes directly within your automated tasks.

When a Bosun task involves significant code changes, it is often beneficial to manage these changes through pull requests. This not only provides a clear history of modifications but also facilitates collaboration and review.

Pull Request Visibility in the App

Pull requests created from a task now surface directly inside the run view. Bosun shows a dedicated card with the PR title, number, state (including draft status), and a quick summary of additions, deletions, and changed files. The card links straight to GitHub so reviewers can jump from the automation run to the live branch.

If a workflow updates the same pull request multiple times, the card refreshes automatically so everyone sees the latest status without scrolling through agent output. This makes pull requests a first-class part of the session alongside logs and step context.

The Built-in Pull Request Agent

Bosun ships with a dedicated pull_request agent. It comes with an opinionated system prompt that:

  • Reviews recent changes and diffs before drafting the PR body.
  • Uses a neutral, professional tone with scoped summaries and follow-up notes.
  • Automatically stages files, creates a commit (allowing empty commits when needed), pushes the branch, and finally opens or updates the GitHub pull request.
  • Defaults to creating draft pull requests unless told otherwise and always returns the PR URL.

Because the agent already knows how to summarise changes, you can often omit detailed instructions. Provide short guidance when you want to highlight context or direct the agent toward specific call-outs.

Example: Create a Draft Pull Request

Use the built-in agent early in a workflow to announce that work has started:

  - name: Create a draft pull request
agent:
extends: pull_request
instructions: "Open a draft PR summarising the work completed so far."

If the branch does not yet contain committed changes, the agent creates an empty commit so the pull request still opens successfully.

Example: Finalise and Mark Ready for Review

When your workflow finishes its changes, you can re-run the agent with different tool settings to flip the PR out of draft:

  - name: Finalise the pull request
agent:
extends: pull_request
instructions: "Update the existing pull request and mark it ready for review."
tools:
- name: finalize_pull_request
extends: create_or_update_pull_request
with:
draft: false

Only the tool configuration changes here: setting draft: false tells the agent to mark the pull request as ready after updating the summary.

Customising Behaviour

  • Tone or structure: Override instructions or add constraints when you need a specific format (e.g., include testing notes, deployment steps, or risk callouts).
  • Skipping drafts: If your process never uses draft PRs, set draft: false on the tool definition in every pull request step.