From b6b6a95f002590dfbdd9dc8184f2efed82716950 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 11 May 2026 18:10:01 +0000 Subject: [PATCH 1/2] Skip live API test on rate limit errors Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .../js/frontmatter_hash_github_api.test.cjs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/actions/setup/js/frontmatter_hash_github_api.test.cjs b/actions/setup/js/frontmatter_hash_github_api.test.cjs index b74c8118a36..41dbf790c45 100644 --- a/actions/setup/js/frontmatter_hash_github_api.test.cjs +++ b/actions/setup/js/frontmatter_hash_github_api.test.cjs @@ -403,9 +403,19 @@ describe("frontmatter_hash with GitHub API", () => { console.log(`\nšŸ” Fetching live data from GitHub API: ${owner}/${repo}/${workflowPath}@${ref}`); // Compute hash using live API data - const hash = await computeFrontmatterHash(workflowPath, { - fileReader, - }); + let hash; + try { + hash = await computeFrontmatterHash(workflowPath, { + fileReader, + }); + } catch (err) { + if (err.message && err.message.toLowerCase().includes("rate limit")) { + console.log("Skipping live API test - GitHub API rate limit exceeded"); + console.log("This is expected when the API rate limit is reached during CI runs"); + return; + } + throw err; + } // Verify hash format expect(hash).toMatch(/^[a-f0-9]{64}$/); From 3fe9818b3051732db209ef5aa9d5e9806aa10b8e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 11 May 2026 18:10:38 +0000 Subject: [PATCH 2/2] Use optional chaining for rate limit error check Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/frontmatter_hash_github_api.test.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/setup/js/frontmatter_hash_github_api.test.cjs b/actions/setup/js/frontmatter_hash_github_api.test.cjs index 41dbf790c45..c0f4fb88084 100644 --- a/actions/setup/js/frontmatter_hash_github_api.test.cjs +++ b/actions/setup/js/frontmatter_hash_github_api.test.cjs @@ -409,7 +409,7 @@ describe("frontmatter_hash with GitHub API", () => { fileReader, }); } catch (err) { - if (err.message && err.message.toLowerCase().includes("rate limit")) { + if (err.message?.toLowerCase().includes("rate limit")) { console.log("Skipping live API test - GitHub API rate limit exceeded"); console.log("This is expected when the API rate limit is reached during CI runs"); return;