Skip to content

Commit b08f07d

Browse files
committed
Now using a 'raw.githubusercontent.com' link to avoid rate limitting
1 parent a8f7bcc commit b08f07d

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

dist/setup/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80008,14 +80008,13 @@ class MicrosoftDistributions extends base_installer_1.JavaBase {
8000880008
const branch = 'main';
8000980009
const filePath = 'general_info/microsoft-openjdk-versions.json';
8001080010
let releases = null;
80011-
const fileUrl = `https://api.github.com/repos/${owner}/${repository}/contents/${filePath}?ref=${branch}`;
80012-
const headers = (0, util_1.getGitHubHttpHeaders)();
80011+
const fileUrl = `https://raw.githubusercontent.com/${owner}/${repository}/refs/heads/${branch}/${filePath}`;
8001380012
let response = null;
8001480013
if (core.isDebug()) {
8001580014
console.time('Retrieving available versions for Microsoft took'); // eslint-disable-line no-console
8001680015
}
8001780016
try {
80018-
response = yield this.http.getJson(fileUrl, headers);
80017+
response = yield this.http.getJson(fileUrl);
8001980018
if (!response.result) {
8002080019
return null;
8002180020
}

src/distributions/microsoft/installer.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
import {
88
extractJdkFile,
99
getDownloadArchiveExtension,
10-
getGitHubHttpHeaders,
1110
renameWinArchive
1211
} from '../../util';
1312
import * as gpg from '../../gpg';
@@ -127,9 +126,7 @@ export class MicrosoftDistributions extends JavaBase {
127126
const branch = 'main';
128127
const filePath = 'general_info/microsoft-openjdk-versions.json';
129128
let releases: tc.IToolRelease[] | null = null;
130-
const fileUrl = `https://api.github.com/repos/${owner}/${repository}/contents/${filePath}?ref=${branch}`;
131-
132-
const headers = getGitHubHttpHeaders();
129+
const fileUrl = `https://raw.githubusercontent.com/${owner}/${repository}/refs/heads/${branch}/${filePath}`;
133130

134131
let response: TypedResponse<tc.IToolRelease[]> | null = null;
135132

@@ -138,7 +135,7 @@ export class MicrosoftDistributions extends JavaBase {
138135
}
139136

140137
try {
141-
response = await this.http.getJson<tc.IToolRelease[]>(fileUrl, headers);
138+
response = await this.http.getJson<tc.IToolRelease[]>(fileUrl);
142139
if (!response.result) {
143140
return null;
144141
}

0 commit comments

Comments
 (0)