mirror of
https://github.com/actions/setup-java.git
synced 2026-07-08 14:21:50 +00:00
Now using a 'raw.githubusercontent.com' link to avoid rate limitting
This commit is contained in:
parent
a8f7bcc45a
commit
b08f07db6d
5
dist/setup/index.js
vendored
5
dist/setup/index.js
vendored
@ -80008,14 +80008,13 @@ class MicrosoftDistributions extends base_installer_1.JavaBase {
|
||||
const branch = 'main';
|
||||
const filePath = 'general_info/microsoft-openjdk-versions.json';
|
||||
let releases = null;
|
||||
const fileUrl = `https://api.github.com/repos/${owner}/${repository}/contents/${filePath}?ref=${branch}`;
|
||||
const headers = (0, util_1.getGitHubHttpHeaders)();
|
||||
const fileUrl = `https://raw.githubusercontent.com/${owner}/${repository}/refs/heads/${branch}/${filePath}`;
|
||||
let response = null;
|
||||
if (core.isDebug()) {
|
||||
console.time('Retrieving available versions for Microsoft took'); // eslint-disable-line no-console
|
||||
}
|
||||
try {
|
||||
response = yield this.http.getJson(fileUrl, headers);
|
||||
response = yield this.http.getJson(fileUrl);
|
||||
if (!response.result) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -7,7 +7,6 @@ import {
|
||||
import {
|
||||
extractJdkFile,
|
||||
getDownloadArchiveExtension,
|
||||
getGitHubHttpHeaders,
|
||||
renameWinArchive
|
||||
} from '../../util';
|
||||
import * as gpg from '../../gpg';
|
||||
@ -127,9 +126,7 @@ export class MicrosoftDistributions extends JavaBase {
|
||||
const branch = 'main';
|
||||
const filePath = 'general_info/microsoft-openjdk-versions.json';
|
||||
let releases: tc.IToolRelease[] | null = null;
|
||||
const fileUrl = `https://api.github.com/repos/${owner}/${repository}/contents/${filePath}?ref=${branch}`;
|
||||
|
||||
const headers = getGitHubHttpHeaders();
|
||||
const fileUrl = `https://raw.githubusercontent.com/${owner}/${repository}/refs/heads/${branch}/${filePath}`;
|
||||
|
||||
let response: TypedResponse<tc.IToolRelease[]> | null = null;
|
||||
|
||||
@ -138,7 +135,7 @@ export class MicrosoftDistributions extends JavaBase {
|
||||
}
|
||||
|
||||
try {
|
||||
response = await this.http.getJson<tc.IToolRelease[]>(fileUrl, headers);
|
||||
response = await this.http.getJson<tc.IToolRelease[]>(fileUrl);
|
||||
if (!response.result) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user