File tree 2 files changed +15
-4
lines changed
2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change
1
+ open Devkit
2
+
3
+ let log = Log. from " context"
4
+
1
5
exception Context_Error of string
2
6
3
7
type cfg_make_args =
4
8
| LocalMake of string
5
9
| RemoteMake of string * Github .t
6
10
7
- type cfg_sources =
11
+ type cfg_origin =
8
12
| Local
9
13
| Remote
10
14
11
15
type data = {
12
16
mutable cfg_path : string ;
13
17
mutable cfg_filename : string ;
14
- cfg_source : cfg_sources ;
18
+ cfg_source : cfg_origin ;
15
19
cfg_action_after_refresh : Config .t -> unit ;
16
20
secrets_path : string ;
17
21
state_path : string ;
@@ -45,6 +49,13 @@ let resolve_cfg_getter = function
45
49
| Remote -> get_remote_cfg_json_url
46
50
47
51
let refresh_config ctx =
52
+ ( match ctx.data.cfg_source with
53
+ | Local -> log#info " attempting to retrieve config locally"
54
+ | Remote ->
55
+ match ctx.secrets.gh_token with
56
+ | None -> log#info " attempting to retrieve config remotely without gh_token"
57
+ | Some _ -> log#info " attempting to retrieve config remotely with gh_token"
58
+ );
48
59
let getter = resolve_cfg_getter ctx.data.cfg_source in
49
60
let % lwt cfg_json = getter ctx.data.cfg_path in
50
61
ctx.cfg < - Config. make cfg_json ctx.secrets;
Original file line number Diff line number Diff line change @@ -4,14 +4,14 @@ type cfg_make_args =
4
4
| LocalMake of string
5
5
| RemoteMake of string * Github .t
6
6
7
- type cfg_sources =
7
+ type cfg_origin =
8
8
| Local
9
9
| Remote
10
10
11
11
type data = {
12
12
mutable cfg_path : string ;
13
13
mutable cfg_filename : string ;
14
- cfg_source : cfg_sources ;
14
+ cfg_source : cfg_origin ;
15
15
cfg_action_after_refresh : Config .t -> unit ;
16
16
secrets_path : string ;
17
17
state_path : string ;
You can’t perform that action at this time.
0 commit comments