diff --git a/dist/cleanup/index.js b/dist/cleanup/index.js index e122576..c626d4f 100644 --- a/dist/cleanup/index.js +++ b/dist/cleanup/index.js @@ -74415,9 +74415,9 @@ const fs_1 = __nccwpck_require__(7147); const core_1 = __nccwpck_require__(6762); const crypto_1 = __nccwpck_require__(6113); const path_1 = __nccwpck_require__(1017); -// Set up Octokit in the same way as @actions/github (see https://git.io/Jy9YP) -const baseUrl = process.env['GITHUB_API_URL'] || 'https://api.github.com'; -const GitHub = core_1.Octokit.defaults({ +// Set up Octokit for github.com only and in the same way as @actions/github (see https://git.io/Jy9YP) +const baseUrl = 'https://api.github.com'; +const GitHubDotCom = core_1.Octokit.defaults({ baseUrl, request: { agent: new httpClient.HttpClient().getAgent(baseUrl) @@ -74438,7 +74438,7 @@ function getLatestRelease(repo) { return __awaiter(this, void 0, void 0, function* () { const githubToken = getGitHubToken(); const options = githubToken.length > 0 ? { auth: githubToken } : {}; - const octokit = new GitHub(options); + const octokit = new GitHubDotCom(options); return (yield octokit.request('GET /repos/{owner}/{repo}/releases/latest', { owner: c.GRAALVM_GH_USER, repo diff --git a/dist/main/index.js b/dist/main/index.js index b661fa3..4555e55 100644 --- a/dist/main/index.js +++ b/dist/main/index.js @@ -75162,9 +75162,9 @@ const fs_1 = __nccwpck_require__(7147); const core_1 = __nccwpck_require__(6762); const crypto_1 = __nccwpck_require__(6113); const path_1 = __nccwpck_require__(1017); -// Set up Octokit in the same way as @actions/github (see https://git.io/Jy9YP) -const baseUrl = process.env['GITHUB_API_URL'] || 'https://api.github.com'; -const GitHub = core_1.Octokit.defaults({ +// Set up Octokit for github.com only and in the same way as @actions/github (see https://git.io/Jy9YP) +const baseUrl = 'https://api.github.com'; +const GitHubDotCom = core_1.Octokit.defaults({ baseUrl, request: { agent: new httpClient.HttpClient().getAgent(baseUrl) @@ -75185,7 +75185,7 @@ function getLatestRelease(repo) { return __awaiter(this, void 0, void 0, function* () { const githubToken = getGitHubToken(); const options = githubToken.length > 0 ? { auth: githubToken } : {}; - const octokit = new GitHub(options); + const octokit = new GitHubDotCom(options); return (yield octokit.request('GET /repos/{owner}/{repo}/releases/latest', { owner: c.GRAALVM_GH_USER, repo diff --git a/src/utils.ts b/src/utils.ts index 5ec71ac..ba1d77d 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -9,9 +9,9 @@ import {Octokit} from '@octokit/core' import {createHash} from 'crypto' import {join} from 'path' -// Set up Octokit in the same way as @actions/github (see https://git.io/Jy9YP) -const baseUrl = process.env['GITHUB_API_URL'] || 'https://api.github.com' -const GitHub = Octokit.defaults({ +// Set up Octokit for github.com only and in the same way as @actions/github (see https://git.io/Jy9YP) +const baseUrl = 'https://api.github.com' +const GitHubDotCom = Octokit.defaults({ baseUrl, request: { agent: new httpClient.HttpClient().getAgent(baseUrl) @@ -38,7 +38,7 @@ export async function getLatestRelease( ): Promise { const githubToken = getGitHubToken() const options = githubToken.length > 0 ? {auth: githubToken} : {} - const octokit = new GitHub(options) + const octokit = new GitHubDotCom(options) return ( await octokit.request('GET /repos/{owner}/{repo}/releases/latest', { owner: c.GRAALVM_GH_USER,