Skip to content

Commit f56c65d

Browse files
committed
Fix the README.md
1 parent 431fa51 commit f56c65d

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

README.md

+12-10
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ using GitHub.Octokit.Client.Authentication;
5555

5656
var tokenProvider = new TokenProvider(Environment.GetEnvironmentVariable("GITHUB_TOKEN") ?? "");
5757
var adapter = RequestAdapter.Create(new TokenAuthProvider(tokenProvider));
58-
await MakeRequest(new GitHubClient(adapter));
58+
var gitHubClient = new GitHubClient(adapter);
5959

6060
try
6161
{
@@ -84,6 +84,8 @@ var adapter = new ClientFactory()
8484
.WithBaseUrl("https://api.github.com")
8585
.Build();
8686

87+
var gitHubClient = new GitHubClient(adapter);
88+
8789
try
8890
{
8991
var response = await gitHubClient.Repositories.GetAsync();
@@ -102,21 +104,21 @@ This SDK supports [Personal Access Tokens (classic)](https://docs.github.com/en/
102104
In order to use either type of Personal Access token, you can use the `TokenAuthProvider` constructor option when constructing a new token provider, like so:
103105

104106
```csharp
105-
var tokenProvider = new TokenProvider(Environment.GetEnvironmentVariable("GITHUB_TOKEN") ?? "");
106-
var adapter = RequestAdapter.Create(new TokenAuthProvider(tokenProvider));
107-
var gitHubClient = new GitHubClient(adapter);
107+
var tokenProvider = new TokenProvider(Environment.GetEnvironmentVariable("GITHUB_TOKEN") ?? "");
108+
var adapter = RequestAdapter.Create(new TokenAuthProvider(tokenProvider));
109+
var gitHubClient = new GitHubClient(adapter);
108110
```
109111

110112
In order to authenticate as a GitHub App, you can use the `AppInstallationAuthProvider` constructor option:
111113

112114
```csharp
113-
var githubAppTokenProvider = new GitHubAppTokenProvider();
114-
var rsa = RSA.Create();
115-
rsa.ImportFromPem(PRIVATE_KEY_PATH);
115+
var githubAppTokenProvider = new GitHubAppTokenProvider();
116+
var rsa = RSA.Create();
117+
rsa.ImportFromPem(PRIVATE_KEY_PATH);
116118

117-
var aiAccessTokenProvider = new AppInstallationTokenProvider(CLIENT_ID, rsa, INSTALLATION_ID, githubAppTokenProvider);
118-
var aiAdapter = RequestAdapter.Create(new AppInstallationAuthProvider(aiAccessTokenProvider));
119-
var aiGitHubClient = new GitHubClient(aiAdapter);
119+
var aiAccessTokenProvider = new AppInstallationTokenProvider(CLIENT_ID, rsa, INSTALLATION_ID, githubAppTokenProvider);
120+
var aiAdapter = RequestAdapter.Create(new AppInstallationAuthProvider(aiAccessTokenProvider));
121+
var aiGitHubClient = new GitHubClient(aiAdapter);
120122
```
121123

122124
To see more detailed examples, view [the cli/ directory in this repo](cli/).

0 commit comments

Comments
 (0)