diff --git a/src/bin/server/worker.rs b/src/bin/server/worker.rs index 5a7fe35..97a7875 100644 --- a/src/bin/server/worker.rs +++ b/src/bin/server/worker.rs @@ -10,6 +10,7 @@ use std::str; use std::time::{Duration, Instant}; const MINIMUM_DELAY_BETWEEN_INDEX_BACKUPS: Duration = Duration::from_secs(60 * 60); +const SILENCE_LABEL: &str = "rla-silenced"; pub struct Worker { debug_post: Option<(String, u32)>, @@ -270,6 +271,14 @@ impl Worker { info!("Build results outdated, skipping report."); return Ok(()); } + if pr_info + .labels + .iter() + .any(|label| label.name == SILENCE_LABEL) + { + info!("PR has label `{SILENCE_LABEL}`, skipping report"); + return Ok(()); + } } let (repo, pr) = match self.debug_post { diff --git a/src/github.rs b/src/github.rs index c535acb..6549aca 100644 --- a/src/github.rs +++ b/src/github.rs @@ -61,6 +61,7 @@ pub struct CommitStatusEvent { #[derive(Deserialize)] pub struct Pr { pub head: PrCommitRef, + pub labels: Vec