From 982832866347cb5b19843d37e7c062ec6731cd5c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 29 Jan 2026 11:17:11 +0000 Subject: [PATCH 1/2] Pass repo-token to binary downloads to avoid rate limiting --- dist/index.js | 8 +++++--- src/installer.ts | 11 ++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index 5988a2b1..2ef9a261 100644 --- a/dist/index.js +++ b/dist/index.js @@ -82,7 +82,7 @@ function getProtoc(version, includePreReleases, repoToken) { toolPath = tc.find("protoc", version); // if not: download, extract and cache if (!toolPath) { - toolPath = yield downloadRelease(version); + toolPath = yield downloadRelease(version, repoToken); process.stdout.write("Protoc cached under " + toolPath + os.EOL); } // expose outputs @@ -93,7 +93,7 @@ function getProtoc(version, includePreReleases, repoToken) { }); } exports.getProtoc = getProtoc; -function downloadRelease(version) { +function downloadRelease(version, repoToken) { return __awaiter(this, void 0, void 0, function* () { // Download const fileName = getFileName(version, osPlat, osArch); @@ -101,7 +101,9 @@ function downloadRelease(version) { process.stdout.write("Downloading archive: " + downloadUrl + os.EOL); let downloadPath = null; try { - downloadPath = yield tc.downloadTool(downloadUrl); + // Pass authentication token to avoid rate limiting + const auth = repoToken ? `token ${repoToken}` : undefined; + downloadPath = yield tc.downloadTool(downloadUrl, undefined, auth); } catch (err) { if (err instanceof tc.HTTPError) { diff --git a/src/installer.ts b/src/installer.ts index 487238d8..fbbf5f6e 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -59,7 +59,7 @@ export async function getProtoc( // if not: download, extract and cache if (!toolPath) { - toolPath = await downloadRelease(version); + toolPath = await downloadRelease(version, repoToken); process.stdout.write("Protoc cached under " + toolPath + os.EOL); } @@ -71,7 +71,10 @@ export async function getProtoc( core.addPath(path.join(toolPath, "bin")); } -async function downloadRelease(version: string): Promise { +async function downloadRelease( + version: string, + repoToken: string, +): Promise { // Download const fileName: string = getFileName(version, osPlat, osArch); const downloadUrl: string = util.format( @@ -83,7 +86,9 @@ async function downloadRelease(version: string): Promise { let downloadPath: string | null = null; try { - downloadPath = await tc.downloadTool(downloadUrl); + // Pass authentication token to avoid rate limiting + const auth = repoToken ? `token ${repoToken}` : undefined; + downloadPath = await tc.downloadTool(downloadUrl, undefined, auth); } catch (err) { if (err instanceof tc.HTTPError) { core.debug(err.message); From 36b89182d76f55ddf0442f3277ce1355e96a81af Mon Sep 17 00:00:00 2001 From: Thang Tran Date: Tue, 3 Feb 2026 12:31:47 +0100 Subject: [PATCH 2/2] added CODEOWNERS --- CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 CODEOWNERS diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 00000000..c8dda112 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +* @egym/sre