From c82eb67278d0f5fb6da9ef74efacf78118197c29 Mon Sep 17 00:00:00 2001 From: Ian Battersby Date: Thu, 17 Mar 2016 12:54:30 +0000 Subject: [PATCH] Update Octokit module for GHE connections. --- modules/Octokit/Octokit.fsx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/modules/Octokit/Octokit.fsx b/modules/Octokit/Octokit.fsx index fb2dc0827eb..35c6b738d42 100644 --- a/modules/Octokit/Octokit.fsx +++ b/modules/Octokit/Octokit.fsx @@ -93,6 +93,26 @@ let createClientWithToken token = return github } +let createGHEClient url user password = + async { + let credentials = Credentials(user, password) + let httpClient = new HttpClientWithTimeout(TimeSpan.FromMinutes 20.) + let connection = new Connection(new ProductHeaderValue("FAKE"), new Uri(url), new InMemoryCredentialStore(credentials), httpClient, new SimpleJsonSerializer()) + let github = new GitHubClient(connection) + github.Credentials <- credentials + return github + } + +let createGHEClientWithToken url token = + async { + let credentials = Credentials(token) + let httpClient = new HttpClientWithTimeout(TimeSpan.FromMinutes 20.) + let connection = new Connection(new ProductHeaderValue("FAKE"), new Uri(url), new InMemoryCredentialStore(credentials), httpClient, new SimpleJsonSerializer()) + let github = new GitHubClient(connection) + github.Credentials <- credentials + return github + } + let private makeRelease draft owner project version prerelease (notes:seq) (client : Async) = retryWithArg 5 client <| fun client' -> async { let data = new NewRelease(version)