Extract client creation
Also default to use the language server version in the user agent
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import {Octokit} from "@octokit/rest";
|
||||
import {version} from "../package.json";
|
||||
|
||||
export function getClient(token: string, userAgent?: string): Octokit {
|
||||
return new Octokit({
|
||||
auth: token,
|
||||
userAgent: userAgent || `GitHub Actions Language Server (${version})`
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user