File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -237,8 +237,7 @@ module Action (Github_api : Api.Github) (Slack_api : Api.Slack) = struct
237
237
let signing_key = Context. gh_hook_token_of_secrets secrets repo.url in
238
238
Github. validate_signature ?signing_key ~headers body
239
239
in
240
- let repo_is_supported secrets payload =
241
- let repo = Github. repo_of_notification payload in
240
+ let repo_is_supported secrets (repo : Github_t.repository ) =
242
241
List. exists secrets.repos ~f: (fun r -> String. equal r.url repo.url)
243
242
in
244
243
try % lwt
@@ -249,14 +248,14 @@ module Action (Github_api : Api.Github) (Slack_api : Api.Slack) = struct
249
248
match validate_signature secrets payload with
250
249
| Error e -> action_error e
251
250
| Ok () ->
252
- match repo_is_supported secrets payload with
253
- | false -> action_error " unsupported repository"
251
+ let repo = Github. repo_of_notification payload in
252
+ match repo_is_supported secrets repo with
253
+ | false -> action_error @@ Printf. sprintf " unsupported repository %s" repo.url
254
254
| true ->
255
255
( match % lwt refresh_repo_config ctx payload with
256
256
| Error e -> action_error e
257
257
| Ok () ->
258
258
let % lwt notifications = generate_notifications ctx payload in
259
- let repo = Github. repo_of_notification payload in
260
259
let % lwt () = Lwt. join [ send_notifications ctx notifications; do_github_tasks ctx repo payload ] in
261
260
( match ctx.state_filepath with
262
261
| None -> Lwt. return_unit
You can’t perform that action at this time.
0 commit comments