2024-04-09 22:51:55 +01:00
|
|
|
use actix::prelude::*;
|
|
|
|
|
|
|
|
use crate::server::{
|
|
|
|
config::{self, ForgeType},
|
|
|
|
forge,
|
|
|
|
};
|
|
|
|
|
|
|
|
use super::AdvanceMainTo;
|
2024-04-09 19:30:05 +01:00
|
|
|
|
|
|
|
pub async fn check_next(
|
2024-04-09 22:51:55 +01:00
|
|
|
next: forge::Commit,
|
|
|
|
repo_details: config::RepoDetails,
|
|
|
|
addr: Addr<super::RepoActor>,
|
|
|
|
net: kxio::network::Network,
|
2024-04-09 19:30:05 +01:00
|
|
|
) {
|
2024-04-09 22:51:55 +01:00
|
|
|
let is_success = match repo_details.forge.forge_type {
|
|
|
|
ForgeType::ForgeJo => {
|
|
|
|
forge::forgejo::get_commit_status(next.clone(), repo_details, net).await
|
|
|
|
}
|
|
|
|
};
|
|
|
|
if is_success {
|
|
|
|
addr.do_send(AdvanceMainTo(next));
|
|
|
|
}
|
2024-04-09 19:30:05 +01:00
|
|
|
}
|