(url: &str)
| 4009 | } |
| 4010 | |
| 4011 | fn parse_github_remote(url: &str) -> Option<(String, String)> { |
| 4012 | let normalized = url.trim().trim_end_matches('/').trim_end_matches(".git"); |
| 4013 | let path = if let Some(value) = normalized.strip_prefix("https://github.com/") { |
| 4014 | value |
| 4015 | } else if let Some(value) = normalized.strip_prefix("http://github.com/") { |
| 4016 | value |
| 4017 | } else if let Some(value) = normalized.strip_prefix("ssh://git@github.com/") { |
| 4018 | value |
| 4019 | } else if let Some(value) = normalized.strip_prefix("git@github.com:") { |
| 4020 | value |
| 4021 | } else { |
| 4022 | return None; |
| 4023 | }; |
| 4024 | |
| 4025 | let mut parts = path.split('/'); |
| 4026 | let owner = parts.next()?.trim(); |
| 4027 | let repo = parts.next()?.trim(); |
| 4028 | if owner.is_empty() || repo.is_empty() { |
| 4029 | return None; |
| 4030 | } |
| 4031 | Some((owner.to_string(), repo.to_string())) |
| 4032 | } |
| 4033 | |
| 4034 | fn provider_secret_keys(provider: &str) -> Vec<&'static str> { |
| 4035 | match provider { |
no test coverage detected