create_hook(repository, options) {
    return Promise
            .try(() => {
              let { conf, client }  = GitHub.client(repository, options)
                , owner             = repository.username()
                , repo              = repository.repo()
                , secret            = _.get(conf, 'hook.secret')
                , url               = hook_url
                ;

              let msg = {
                  owner
                , repo
                , name    : 'web'
                , events  : ['*']
                , config  : {
                      url
                    , content_type  : 'json'
                    , insecure_ssl  : '0'
                    , secret
                  }
              };

              return client.repos.createHook(msg);
            });
  }
// try to hook / on success, update
try to hook / on success, update
try to hook / on success update
create_hook(repository, options) {
    return Promise
            .try(() => {
              let { conf, client }  = GitHub.client(repository, options)
                , owner             = repository.username()
                , repo              = repository.repo()
                , secret            = _.get(conf, 'hook.secret')
                , url               = hook_url
                ;
              let msg = {
                  owner
                , repo
                , name    : 'web'
                , events  : ['*']
                , config  : {
                      url
                    , content_type  : 'json'
                    , insecure_ssl  : '0'
                    , secret
                  }
              };
              return client.repos.createHook(msg);
            });
  }
create_hook ( repository , options ) { return Promise . try ( ( ) => { let { conf , client } = GitHub . client ( repository , options ) , owner = repository . username ( ) , repo = repository . repo ( ) , secret = _ . get ( conf , 'hook.secret' ) , url = hook_url ; let msg = { owner , repo , name : 'web' , events : [ '*' ] , config : { url , content_type : 'json' , insecure_ssl : '0' , secret } } ; return client . repos . createHook ( msg ) ; } ) ; }
try to hook / on success, update
try to hook / on success update