@@ -12,6 +12,7 @@ type t = {
12
12
state_filepath : string option ;
13
13
mutable secrets : Config_t .secrets option ;
14
14
state : State_t .state ;
15
+ verbose : bool ;
15
16
}
16
17
17
18
let default : t =
@@ -21,12 +22,14 @@ let default : t =
21
22
state_filepath = None ;
22
23
secrets = None ;
23
24
state = State. empty () ;
25
+ verbose = true ;
24
26
}
25
27
26
- let make ?config_filename ?secrets_filepath ?state_filepath () =
28
+ let make ?config_filename ?secrets_filepath ?state_filepath ? verbose () =
27
29
let config_filename = Option. value config_filename ~default: default.config_filename in
28
30
let secrets_filepath = Option. value secrets_filepath ~default: default.secrets_filepath in
29
- { default with config_filename; secrets_filepath; state_filepath }
31
+ let verbose = Option. value verbose ~default: default.verbose in
32
+ { default with config_filename; secrets_filepath; state_filepath; verbose }
30
33
31
34
let get_secrets_exn ctx =
32
35
match ctx.secrets with
@@ -76,9 +79,11 @@ let refresh_state ctx =
76
79
let print_config ctx repo_url =
77
80
let cfg = State. find_repo_config_exn ctx.state repo_url in
78
81
let secrets = get_secrets_exn ctx in
79
- let token = gh_hook_token_of_secrets secrets repo_url in
80
- log#info " using prefix routing:" ;
82
+ let hook_token = gh_hook_token_of_secrets secrets repo_url in
83
+ let token = gh_token_of_secrets secrets repo_url in
84
+ Stdio. print_endline " using prefix routing:" ;
81
85
Rule.Prefix. print_prefix_routing cfg.prefix_rules.rules;
82
- log#info " using label routing:" ;
86
+ Stdio. print_endline " using label routing:" ;
83
87
Rule.Label. print_label_routing cfg.label_rules.rules;
84
- log#info " signature checking %s" (if Option. is_some token then " enabled" else " disabled" )
88
+ Stdio. printf " signature checking %s\n " (if Option. is_some hook_token then " enabled" else " disabled" );
89
+ Stdio. printf " personal access token %s\n " (if Option. is_some token then " enabled" else " disabled" )
0 commit comments