let make_issue user repo token dir issue =
  let open Github.Monad in
  (* This is treated as the beginning of the "phrase" since it matches *)
  (* tuareg-find-phrase-beginning-and-regexp *)
  let open Github_t in
  let filename = Filename.concat dir (string_of_int issue.issue_number) in
  Out_channel.with_file filename ~f:( fun file ->
    printf "Creating issue %d\n" issue.issue_number;
    let labels = (List.map ~f:(fun l -> l.label_name) issue.issue_labels) in
    fprintf file "%s\nopened on ... by %s\ntags: %s\n\n%s"
      issue.issue_title issue.issue_user.user_login
      (String.concat ~sep:" " labels) issue.issue_body

Generated by Phil Hagelberg using scpaste at Tue Nov 12 14:05:50 2013. PST. (original)