Skip to content

Commit

Permalink
feat: support dickens-topic with local repo
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegec committed Mar 20, 2024
1 parent 02c64e1 commit 9e058a8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion server/src/bot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,12 @@ pub async fn answer(bot: Bot, msg: Message, cmd: Command, pool: DbPool) -> Respo

// get topic of pr
match crab.pulls("AOSC-Dev", "aosc-os-abbs").get(pr_number).await {
Ok(pr) => match dickens::topic::report(pr.head.ref_field.as_str()).await {
Ok(pr) => match dickens::topic::report(
pr.head.ref_field.as_str(),
ARGS.local_repo.clone(),
)
.await
{
Ok(report) => {
// post report as github comment
match crab
Expand Down
4 changes: 4 additions & 0 deletions server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ pub struct Args {
/// OpenTelemetry
#[arg(env = "BUILDIT_OTLP")]
pub otlp_url: Option<String>,

/// Local repo path if available
#[arg(env = "BUILDIT_REPO_PATH")]
pub local_repo: Option<PathBuf>,
}

pub static ARGS: Lazy<Args> = Lazy::new(Args::parse);
Expand Down

0 comments on commit 9e058a8

Please sign in to comment.