Skip to main content

create_pull_request

Function create_pull_request 

Source
pub async fn create_pull_request(
    client: &Octocrab,
    owner: &str,
    repo: &str,
    title: &str,
    head_branch: &str,
    base_branch: &str,
    body: Option<&str>,
) -> Result<PrCreateResult>
Expand description

Creates a pull request on GitHub.

§Arguments

  • client - Authenticated Octocrab client
  • owner - Repository owner
  • repo - Repository name
  • title - PR title
  • head_branch - Head branch (the branch with changes)
  • base_branch - Base branch (the branch to merge into)
  • body - Optional PR body text

§Returns

PrCreateResult with PR metadata.

§Errors

Returns an error if the API call fails or the user lacks write access.