New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Header needed for Checks API for Enterprise Server #478
Comments
Suggest we revert #386 for now. |
Solved by #481 |
I'm still getting this error. Tried to built the lambdas by my own yesterday after #481 got merged as well as the just released 0.9.0 lambda zips.
|
you are still using an older commit for your Lambdas .. |
No. I'm very sure I'm running the lambdas v0.9.0 as downloadable here from Github. The header What could be the reason why the header |
@buamod I get the same @samuelb I missed modifying the test for the fix that made it in to v0.9.0, so I modified L120 of request: mockedRequestInterface.defaults({ baseUrl: githubServerUrl, mediaType: { previews: ['antiope'] } }), The test passed. I also found that you can enable debug in octokit. 2021-01-22T13:33:31.960Z a3e98909-2b21-52b0-9e5c-d18dfd7d23cf DEBUG request {
method: 'GET',
baseUrl: 'https://githubtest.internal/api/v3',
headers: {
accept: 'application/vnd.github.v3+json',
'user-agent': 'octokit-rest.js/18.0.9 octokit-core.js/3.2.4 Node.js/12.19.0 (linux; x64)'
},
mediaType: { format: '', previews: [ 'antiope' ] },
request: { hook: [Function: bound bound register] },
url: '/repos/{owner}/{repo}/check-runs/{check_run_id}',
check_run_id: 845,
owner: 'ActionsTest',
repo: 'repo-test'
} The header is still passed but a new |
When adding
This mediaType is not set. |
I just see from the user agent, the octokit-rest.js version differs from yours. You suggested earlier that reverting #386 would be one option to solve it. Could it be that #481 actually don't solved that problem but you accidentally considered it to be fixed as you build it using octokit-rest.js/18.0.9? |
Looks like my last compile may have been using a cached library. I re-compiled and got the same result as you. This modification worked for me: export async function createOctoClient(token: string, ghesApiUrl: string = ''): Promise<Octokit> {
const ocktokitOptions: OctokitOptions = {
auth: token,
log: console,
};
if (ghesApiUrl) {
ocktokitOptions.baseUrl = ghesApiUrl;
ocktokitOptions.previews = ['antiope'];
}
return new Octokit(ocktokitOptions);
} |
I can confirm that this is working for me 👍 iff --git a/modules/runners/lambdas/runners/src/scale-runners/gh-auth.ts b/modules/runners/lambdas/runners/src/scale-runners/gh-auth.ts
index 01dc3cf..ae3720e 100644
--- a/modules/runners/lambdas/runners/src/scale-runners/gh-auth.ts
+++ b/modules/runners/lambdas/runners/src/scale-runners/gh-auth.ts
@@ -11,6 +11,7 @@ export async function createOctoClient(token: string, ghesApiUrl: string = ''):
};
if (ghesApiUrl) {
ocktokitOptions.baseUrl = ghesApiUrl;
+ ocktokitOptions.previews = ['antiope'];
}
return new Octokit(ocktokitOptions);
}
@@ -51,7 +52,6 @@ export async function createGithubAuth(
if (ghesApiUrl) {
authOptions.request = request.defaults({
baseUrl: ghesApiUrl,
- mediaType: { previews: ['antiope'] }
});
}
return await createAppAuth(authOptions)({ type: authType }); From CloudWatch:
|
Opened #482 |
Created release 0.9.1 |
Likely caused by #386
The text was updated successfully, but these errors were encountered: