Skip to content

Commit

Permalink
Do not lose error message when createCheckRun query fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zimmi48 committed May 22, 2023
1 parent b8a8a62 commit 692ddd9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions bot-components/GitHub_mutations.ml
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,19 @@ let create_check_run ~bot_info ?conclusion ~name ~repo_id ~head_sha ~status
}\n\n\
}\n"
in
let open Lwt_result.Infix in
makeVariables ~name
~repoId:(GitHub_ID.to_string repo_id)
~headSha:head_sha ~status ~title ?text ~summary ~url:details_url ?conclusion
?externalId:external_id ()
|> serializeVariables |> variablesToJson
|> send_graphql_query ~bot_info ~query
~parse:(Fn.compose parse unsafe_fromJson)
>|= Result.bind ~f:(function
| {createCheckRun= Some {checkRun= Some {url}}} ->
Ok url
| _ ->
Error (f "Warning: Could not retrieve new check run URL.") )
>>= function
| {createCheckRun= Some {checkRun= Some {url}}} ->
Lwt_result.return url
| _ ->
Lwt_result.fail (f "No new check run URL provided in GitHub answer.")

let update_check_run ~bot_info ~check_run_id ~repo_id ~conclusion ?details_url
~title ?text ~summary () =
Expand Down

0 comments on commit 692ddd9

Please sign in to comment.