File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -271,6 +271,12 @@ module Action (Github_api : Api.Github) (Slack_api : Api.Slack) = struct
271
271
end
272
272
| _ -> Lwt. return_unit
273
273
274
+ let cleanup_state (ctx : Context.t ) (payload : Github.t ) =
275
+ match payload with
276
+ | Github. Pull_request { action = Closed ; pull_request = { number; _ } ; repository = { url; _ } ; _ } ->
277
+ State. close_issue ctx.state url number
278
+ | _ -> Lwt. return_unit
279
+
274
280
let process_github_notification (ctx : Context.t ) headers body =
275
281
let validate_signature secrets payload =
276
282
let repo = Github. repo_of_notification payload in
@@ -300,6 +306,7 @@ module Action (Github_api : Api.Github) (Slack_api : Api.Slack) = struct
300
306
( match ctx.state_filepath with
301
307
| None -> Lwt. return_unit
302
308
| Some path ->
309
+ let % lwt () = cleanup_state ctx payload in
303
310
( match % lwt State. save ctx.state path with
304
311
| Ok () -> Lwt. return_unit
305
312
| Error e -> action_error e
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ let get_review_msg { state; _ } repo_url ~issue_num review_id =
65
65
let close_issue { state; lock } repo_url issue_num =
66
66
Lwt_mutex. with_lock lock @@ fun () ->
67
67
let repo_state = find_or_add_repo' state repo_url in
68
- Stringtbl. remove repo_state.issue_tbl issue_num;
68
+ Stringtbl. remove repo_state.issue_tbl ( Int. to_string issue_num) ;
69
69
Lwt. return_unit
70
70
71
71
let set_bot_user_id { state; _ } user_id = state.State_t. bot_user_id < - Some user_id
You can’t perform that action at this time.
0 commit comments