mirror of
https://github.com/graalvm/setup-graalvm.git
synced 2025-01-18 19:26:39 +08:00
Let getLatestRelease()
always query github.com.
This should allow GitHub Enterprise users to use this action. Resolves #26, resolves #27.
This commit is contained in:
parent
778af55c2a
commit
7c84ab1ba7
8
dist/cleanup/index.js
generated
vendored
8
dist/cleanup/index.js
generated
vendored
@ -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
|
||||
|
8
dist/main/index.js
generated
vendored
8
dist/main/index.js
generated
vendored
@ -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
|
||||
|
@ -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<c.LatestReleaseResponse['data']> {
|
||||
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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user