From 06aafe4e0a5505a5b913ca94687739ec28e3d55d Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Tue, 14 Jul 2026 15:36:40 +0800 Subject: [PATCH] Skip `fetchAgentSkills` for `www` typecheck GHA (#47907) ### Context Our TS check GHA occasionally runs into GH rate limits because of `fetchAgentSkills` ### Changes involved - Opting to omit `fetchAgentSkills` for typecheck - `generateStaticContent` is needed still afaict - Allow GITHUB_TOKEN to be passed for `generateStaticContent` - And pass that env var from `typecheck.yml` ## Summary by CodeRabbit ## Summary by CodeRabbit - **Improvements** - Enhanced reliability of GitHub-powered content during site builds. - GitHub API requests now use secure authentication when a token is available, improving consistency and reducing rate-limit risk. - Repository star and agent-skill loading continues to work gracefully without token access. - **Chores** - Streamlined the type-check workflow to use a leaner content build before running TypeScript checks. - Passed the GitHub token through relevant CI task environments to enable authenticated requests. --- .github/workflows/typecheck.yml | 2 ++ apps/www/package.json | 5 +++-- apps/www/scripts/generateStaticContent.mjs | 2 +- apps/www/turbo.jsonc | 6 ++++++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml index e9fb0896e39..e6faaa80661 100644 --- a/.github/workflows/typecheck.yml +++ b/.github/workflows/typecheck.yml @@ -42,6 +42,8 @@ jobs: - name: Run TypeScript type check run: pnpm run typecheck + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Run Lint run: pnpm run lint diff --git a/apps/www/package.json b/apps/www/package.json index 5495f58a98e..aa164943424 100644 --- a/apps/www/package.json +++ b/apps/www/package.json @@ -13,8 +13,9 @@ "lint": "eslint .", "clean": "rimraf node_modules", "pretypecheck": "next typegen", - "typecheck": "pnpm run content:build && tsc --noEmit", - "content:build": "node scripts/generateStaticContent.mjs && node scripts/generateMdContent.mjs && node scripts/fetchAgentSkills.mjs", + "typecheck": "pnpm run content:build:core && tsc --noEmit", + "content:build:core": "node scripts/generateStaticContent.mjs && node scripts/generateMdContent.mjs", + "content:build": "pnpm run content:build:core && node scripts/fetchAgentSkills.mjs", "test": "vitest --run", "test:watch": "vitest watch", "postbuild": "node ./internals/generate-sitemap.mjs && ./../../scripts/upload-static-assets.sh" diff --git a/apps/www/scripts/generateStaticContent.mjs b/apps/www/scripts/generateStaticContent.mjs index 7c8fe24c57b..0fac6a1eaed 100644 --- a/apps/www/scripts/generateStaticContent.mjs +++ b/apps/www/scripts/generateStaticContent.mjs @@ -237,7 +237,7 @@ let stars = 0 // GitHub Stars const fetchOctoData = async () => { const { Octokit } = await import('@octokit/core') - const octokit = new Octokit() + const octokit = new Octokit(process.env.GITHUB_TOKEN ? { auth: process.env.GITHUB_TOKEN } : {}) const res = await octokit.request('GET /repos/{org}/{repo}', { org: 'supabase', repo: 'supabase', diff --git a/apps/www/turbo.jsonc b/apps/www/turbo.jsonc index cc563b675cc..e4ba1802468 100644 --- a/apps/www/turbo.jsonc +++ b/apps/www/turbo.jsonc @@ -2,6 +2,12 @@ "$schema": "./../../node_modules/turbo/schema.json", "extends": ["//"], "tasks": { + "lint": { + "env": ["GITHUB_TOKEN"], + }, + "typecheck": { + "env": ["GITHUB_TOKEN"], + }, "build": { "dependsOn": ["^build"], "env": [