diff --git a/packages/integration/src/github/SingleInstanceGithubCredentialsProvider.ts b/packages/integration/src/github/SingleInstanceGithubCredentialsProvider.ts index 6b5e3318db..bc15007f9d 100644 --- a/packages/integration/src/github/SingleInstanceGithubCredentialsProvider.ts +++ b/packages/integration/src/github/SingleInstanceGithubCredentialsProvider.ts @@ -15,27 +15,16 @@ */ import parseGitUrl from 'git-url-parse'; - +import { GithubAppConfig, GitHubIntegrationConfig } from './config'; +import { createAppAuth } from '@octokit/auth-app'; +import { Octokit, RestEndpointMethodTypes } from '@octokit/rest'; +import { DateTime } from 'luxon'; import { GithubCredentials, GithubCredentialsProvider, GithubCredentialType, } from './types'; -import { GithubAppConfig, GitHubIntegrationConfig } from './config'; -import { Octokit, RestEndpointMethodTypes } from '@octokit/rest'; -import { createAppAuth } from '@octokit/auth-app'; -import { DateTime } from 'luxon'; - -/** - * This accept header is required when calling App APIs in GitHub Enterprise. - * It has no effect on calls to github.com and can probably be removed entirely - * once GitHub Apps is out of preview. - */ -const HEADERS = { - Accept: 'application/vnd.github.machine-man-preview+json', -}; - type InstallationData = { installationId: number; suspended: boolean; @@ -66,6 +55,15 @@ class Cache { date.diff(DateTime.local(), 'minutes').minutes > 50; } +/** + * This accept header is required when calling App APIs in GitHub Enterprise. + * It has no effect on calls to github.com and can probably be removed entirely + * once GitHub Apps is out of preview. + */ +const HEADERS = { + Accept: 'application/vnd.github.machine-man-preview+json', +}; + /** * GithubAppManager issues and caches tokens for a specific GitHub App. */