Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI status updates sent as direct message to author of commit #136

Merged
merged 8 commits into from
Feb 14, 2024
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Yasunari Watanabe <yasunariw@users.noreply.github.com>
koonwen and yasunariw authored Aug 9, 2023
commit 1964e0a3b641e1689d168e2b9a883120b7560fd3
5 changes: 3 additions & 2 deletions lib/action.ml
Original file line number Diff line number Diff line change
@@ -103,8 +103,9 @@ module Action (Github_api : Api.Github) (Slack_api : Api.Slack) = struct
match%lwt Slack_api.lookup_user ~ctx ~email:n.commit.commit.author.email with
(* To send a DM, channel parameter is set to the user id of the recipient *)
| Ok res -> Lwt.return [ res.user.id ]
| Error e -> log#error "%s: nowhere to send status update" e;
Lwt.return []
| Error e ->
log#warn "couldn't match commit email to slack profile: %s" e;
Lwt.return (Option.to_list cfg.prefix_rules.default_channel)
in
let%lwt () = State.set_repo_pipeline_status ctx.state repo.url ~pipeline ~branches ~status:current_status in
match List.is_empty branches with