@@ -30,38 +30,38 @@ pub(super) fn generate_native_pr_trigger(pr: &PrTriggerConfig) -> String {
3030
3131 let mut yaml = String :: from ( "pr:\n " ) ;
3232
33- if let Some ( branches) = & pr. branches {
34- if !branches. include . is_empty ( ) || !branches. exclude . is_empty ( ) {
35- yaml . push_str ( " branches: \n " ) ;
36- if ! branches. include . is_empty ( ) {
37- yaml . push_str ( " include: \n " ) ;
38- for b in & branches . include {
39- yaml . push_str ( & format ! ( " - '{}' \n " , b . replace ( '\'' , "''" ) ) ) ;
40- }
33+ if let Some ( branches) = & pr. branches
34+ && ( !branches. include . is_empty ( ) || !branches. exclude . is_empty ( ) )
35+ {
36+ yaml . push_str ( " branches: \n " ) ;
37+ if !branches . include . is_empty ( ) {
38+ yaml . push_str ( " include: \n " ) ;
39+ for b in & branches . include {
40+ yaml . push_str ( & format ! ( " - '{}' \n " , b . replace ( '\'' , "''" ) ) ) ;
4141 }
42- if !branches . exclude . is_empty ( ) {
43- yaml . push_str ( " exclude: \n " ) ;
44- for b in & branches . exclude {
45- yaml . push_str ( & format ! ( " - '{}' \n " , b . replace ( '\'' , "''" ) ) ) ;
46- }
42+ }
43+ if !branches . exclude . is_empty ( ) {
44+ yaml . push_str ( " exclude: \n " ) ;
45+ for b in & branches . exclude {
46+ yaml . push_str ( & format ! ( " - '{}' \n " , b . replace ( '\'' , "''" ) ) ) ;
4747 }
4848 }
4949 }
5050
51- if let Some ( paths) = & pr. paths {
52- if !paths. include . is_empty ( ) || !paths. exclude . is_empty ( ) {
53- yaml . push_str ( " paths: \n " ) ;
54- if ! paths. include . is_empty ( ) {
55- yaml . push_str ( " include: \n " ) ;
56- for p in & paths . include {
57- yaml . push_str ( & format ! ( " - '{}' \n " , p . replace ( '\'' , "''" ) ) ) ;
58- }
51+ if let Some ( paths) = & pr. paths
52+ && ( !paths. include . is_empty ( ) || !paths. exclude . is_empty ( ) )
53+ {
54+ yaml . push_str ( " paths: \n " ) ;
55+ if !paths . include . is_empty ( ) {
56+ yaml . push_str ( " include: \n " ) ;
57+ for p in & paths . include {
58+ yaml . push_str ( & format ! ( " - '{}' \n " , p . replace ( '\'' , "''" ) ) ) ;
5959 }
60- if !paths . exclude . is_empty ( ) {
61- yaml . push_str ( " exclude: \n " ) ;
62- for p in & paths . exclude {
63- yaml . push_str ( & format ! ( " - '{}' \n " , p . replace ( '\'' , "''" ) ) ) ;
64- }
60+ }
61+ if !paths . exclude . is_empty ( ) {
62+ yaml . push_str ( " exclude: \n " ) ;
63+ for p in & paths . exclude {
64+ yaml . push_str ( & format ! ( " - '{}' \n " , p . replace ( '\'' , "''" ) ) ) ;
6565 }
6666 }
6767 }
0 commit comments