Skip to main content

create_pr

Function create_pr 

Source
pub async fn create_pr(
    provider: &dyn TokenProvider,
    owner: &str,
    repo: &str,
    title: &str,
    base_branch: &str,
    head_branch: &str,
    body: Option<&str>,
) -> Result<PrCreateResult>
Expand description

Creates a pull request on GitHub.

§Arguments

  • provider - Token provider for GitHub credentials
  • owner - Repository owner
  • repo - Repository name
  • title - PR title
  • base_branch - Base branch (the branch to merge into)
  • head_branch - Head branch (the branch with changes)
  • body - Optional PR body text

§Returns

PrCreateResult with PR metadata.

§Errors

Returns an error if:

  • GitHub token is not available from the provider
  • GitHub API call fails
  • User lacks write access to the repository