Skip to main content

post_pr_review

Function post_pr_review 

Source
pub async fn post_pr_review(
    client: &Octocrab,
    owner: &str,
    repo: &str,
    number: u64,
    body: &str,
    event: ReviewEvent,
    comments: &[PrReviewComment],
    commit_id: &str,
) -> Result<u64>
Expand description

Posts a PR review to GitHub.

Uses Octocrab’s custom HTTP POST to create a review with the specified event type. Requires write access to the repository.

§Arguments

  • client - Authenticated Octocrab client
  • owner - Repository owner
  • repo - Repository name
  • number - PR number
  • body - Review comment text
  • event - Review event type (Comment, Approve, or RequestChanges)
  • comments - Inline review comments to attach; entries with line = None are silently skipped
  • commit_id - Head commit SHA to associate with the review; omitted from payload if empty

§Returns

Review ID on success.

§Errors

Returns an error if the API call fails, user lacks write access, or PR is not found.