Skip to content

Commit

Permalink
Merge pull request #1181 from ianbattersby/octokit-ghe
Browse files Browse the repository at this point in the history
Update Octokit module for GHE connections.
  • Loading branch information
forki committed Mar 31, 2016
2 parents 7f46524 + c82eb67 commit 436b6be
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions modules/Octokit/Octokit.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>) (client : Async<GitHubClient>) =
retryWithArg 5 client <| fun client' -> async {
let data = new NewRelease(version)
Expand Down

0 comments on commit 436b6be

Please sign in to comment.