19 lines
605 B
Rust
19 lines
605 B
Rust
|
pub async fn validate_pr(
|
||
|
owner: &str,
|
||
|
repo: &str,
|
||
|
pull_request_id: u32,
|
||
|
current_version: &str,
|
||
|
) -> eyre::Result<Option<String>> {
|
||
|
let base_url = &std::env::var("GITEA_BASE_URL").unwrap();
|
||
|
let token = &std::env::var("GITEA_ACCESS_TOKEN").unwrap();
|
||
|
|
||
|
let commit_titles =
|
||
|
crate::gitea::get_pull_request_commits(base_url, owner, repo, pull_request_id, token)
|
||
|
.await?;
|
||
|
|
||
|
match crate::semantic::get_most_significant_bump(&commit_titles) {
|
||
|
Some(bump) => Ok(Some(crate::semantic::bump_semver(current_version, bump)?)),
|
||
|
None => Ok(None),
|
||
|
}
|
||
|
}
|