MCPcopy Create free account
hub / github.com/bevyengine/bevy-website / leave_comment

Method leave_comment

generate-release/src/github_client.rs:375–394  ·  view source on GitHub ↗
(
        &self,
        repo: BevyRepo,
        issue_number: u64,
        comment: &str,
    )

Source from the content-addressed store, hash-verified

373 /// See the [Github API documentation](https://docs.github.com/en/rest/issues/comments?apiVersion=2022-11-28) for more information.
374 #[allow(clippy::result_large_err)]
375 pub fn leave_comment(
376 &self,
377 repo: BevyRepo,
378 issue_number: u64,
379 comment: &str,
380 ) -> Result<Response, ureq::Error> {
381 let response = self
382 .agent
383 .post(&format!(
384 "https://api.github.com/repos/bevyengine/{repo}/issues/{issue_number}/comments",
385 ))
386 .set("Authorization", &format!("Bearer {}", self.token))
387 .set("Accept", "application/vnd.github+json")
388 .set("X-GitHub-Api-Version", "2022-11-28")
389 .send_json(ureq::json!({
390 "body": comment,
391 }))?;
392
393 Ok(response)
394 }
395}
396
397/// An issue that occurred while opening an issue on Github.

Callers 1

generate_and_open_issueFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected