(
summary: &str,
actor: Option<&str>,
include_coauthor: bool,
)
| 4948 | } |
| 4949 | |
| 4950 | fn github_commit_all( |
| 4951 | summary: &str, |
| 4952 | actor: Option<&str>, |
| 4953 | include_coauthor: bool, |
| 4954 | ) -> anyhow::Result<()> { |
| 4955 | let title = truncate_text(summary.trim(), 72); |
| 4956 | let mut message = if title.trim().is_empty() { |
| 4957 | "Automated update from GitHub run".to_string() |
| 4958 | } else { |
| 4959 | title |
| 4960 | }; |
| 4961 | if include_coauthor { |
| 4962 | if let Some(actor) = actor { |
| 4963 | if !actor.trim().is_empty() { |
| 4964 | message.push_str(&format!( |
| 4965 | "\n\nCo-authored-by: {} <{}@users.noreply.github.com>", |
| 4966 | actor, actor |
| 4967 | )); |
| 4968 | } |
| 4969 | } |
| 4970 | } |
| 4971 | git_run(&["add", "."])?; |
| 4972 | git_run(&["commit", "-m", &message])?; |
| 4973 | Ok(()) |
| 4974 | } |
| 4975 | |
| 4976 | fn github_push_new_branch(branch: &str) -> anyhow::Result<()> { |
| 4977 | git_run(&["push", "-u", "origin", branch]) |
no test coverage detected