Skip to content

Commit 432cb7c

Browse files
authored
fix(ghes): Corrects preview option (#482)
* fix(ghes): Corrects preview option * Test requires `toStrictEqual`
1 parent 0bdc37b commit 432cb7c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

modules/runners/lambdas/runners/src/scale-runners/gh-auth.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ describe('Test createGithubAuth', () => {
4141

4242
// Assert
4343
expect(result.request.endpoint.DEFAULTS.baseUrl).toBe(enterpriseServer);
44+
expect(result.request.endpoint.DEFAULTS.mediaType.previews).toStrictEqual(['antiope']);
4445
});
4546
});
4647

modules/runners/lambdas/runners/src/scale-runners/gh-auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export async function createOctoClient(token: string, ghesApiUrl: string = ''):
1111
};
1212
if (ghesApiUrl) {
1313
ocktokitOptions.baseUrl = ghesApiUrl;
14+
ocktokitOptions.previews = ['antiope'];
1415
}
1516
return new Octokit(ocktokitOptions);
1617
}
@@ -51,7 +52,6 @@ export async function createGithubAuth(
5152
if (ghesApiUrl) {
5253
authOptions.request = request.defaults({
5354
baseUrl: ghesApiUrl,
54-
mediaType: { previews: ['antiope'] }
5555
});
5656
}
5757
return await createAppAuth(authOptions)({ type: authType });

0 commit comments

Comments
 (0)