From 7049802750ccf14e41638d680bb8ce5bfefc4899 Mon Sep 17 00:00:00 2001 From: Half-Shot Date: Mon, 17 Jan 2022 09:50:40 +0000 Subject: [PATCH] UserAgent tweaks --- src/Github/GithubInstance.ts | 7 +++---- src/Notifications/GitHubWatcher.ts | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Github/GithubInstance.ts b/src/Github/GithubInstance.ts index ada8e917..670b3b95 100644 --- a/src/Github/GithubInstance.ts +++ b/src/Github/GithubInstance.ts @@ -6,11 +6,10 @@ import * as GitHubWebhookTypes from "@octokit/webhooks-types"; import { GitHubOAuthTokenResponse, InstallationDataType } from "./Types"; import axios from "axios"; import qs from "querystring"; +import UserAgent from "../UserAgent"; const log = new LogWrapper("GithubInstance"); -const USER_AGENT = "matrix-hookshot v0.0.1"; - interface Installation { account: { login?: string; @@ -44,7 +43,7 @@ export class GithubInstance { public static createUserOctokit(token: string) { return new Octokit({ auth: token, - userAgent: USER_AGENT, + userAgent: UserAgent, }); } @@ -85,7 +84,7 @@ export class GithubInstance { privateKey: this.privateKey, installationId, }, - userAgent: USER_AGENT, + userAgent: UserAgent, }); } diff --git a/src/Notifications/GitHubWatcher.ts b/src/Notifications/GitHubWatcher.ts index ce380e51..a8d66567 100644 --- a/src/Notifications/GitHubWatcher.ts +++ b/src/Notifications/GitHubWatcher.ts @@ -4,7 +4,6 @@ import { GithubInstance } from "../Github/GithubInstance"; import LogWrapper from "../LogWrapper"; import { NotificationWatcherTask } from "./NotificationWatcherTask"; import { RequestError } from "@octokit/request-error"; -import { OctokitResponse } from "@octokit/types"; import Metrics from "../Metrics"; const log = new LogWrapper("GitHubWatcher");