Skip to content

Commit b08bd4a

Browse files
author
nonoroazoro
committed
synchronize with the new octokit api
1 parent 2dd9b19 commit b08bd4a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/core/Gist.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,19 @@ export class Gist
3131
{
3232
this._proxy = proxy;
3333

34-
const options: Record<string, any> = { timeout: 8000 };
34+
const options: Record<string, any> = { request: { timeout: 8000 } };
3535
if (proxy)
3636
{
37-
options["agent"] = new HttpsProxyAgent(proxy);
37+
options.request["agent"] = new HttpsProxyAgent(proxy);
3838
}
39-
this._api = new Github(options);
4039

4140
this._token = token;
42-
if (token)
41+
if (token != null)
4342
{
44-
this._api.authenticate({ token, type: "oauth" });
43+
options["auth"] = `token ${token}`;
4544
}
45+
46+
this._api = new Github(options);
4647
}
4748

4849
/**

0 commit comments

Comments
 (0)