File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ use std::str;
1010use std:: time:: { Duration , Instant } ;
1111
1212const MINIMUM_DELAY_BETWEEN_INDEX_BACKUPS : Duration = Duration :: from_secs ( 60 * 60 ) ;
13+ const SILENCE_LABEL : & str = "rla-silenced" ;
1314
1415pub struct Worker {
1516 debug_post : Option < ( String , u32 ) > ,
@@ -270,6 +271,14 @@ impl Worker {
270271 info ! ( "Build results outdated, skipping report." ) ;
271272 return Ok ( ( ) ) ;
272273 }
274+ if pr_info
275+ . labels
276+ . iter ( )
277+ . any ( |label| label. name == SILENCE_LABEL )
278+ {
279+ info ! ( "PR has label `{SILENCE_LABEL}`, skipping report" ) ;
280+ return Ok ( ( ) ) ;
281+ }
273282 }
274283
275284 let ( repo, pr) = match self . debug_post {
Original file line number Diff line number Diff line change @@ -61,13 +61,19 @@ pub struct CommitStatusEvent {
6161#[ derive( Deserialize ) ]
6262pub struct Pr {
6363 pub head : PrCommitRef ,
64+ pub labels : Vec < Label > ,
6465}
6566
6667#[ derive( Deserialize ) ]
6768pub struct PrCommitRef {
6869 pub sha : String ,
6970}
7071
72+ #[ derive( Deserialize ) ]
73+ pub struct Label {
74+ pub name : String ,
75+ }
76+
7177#[ derive( Deserialize ) ]
7278pub struct CommitMeta {
7379 pub commit : Commit ,
You can’t perform that action at this time.
0 commit comments