From 9c0d058e4b8d011eab182e899a1aeb29a1e597a4 Mon Sep 17 00:00:00 2001 From: Dan Farrelly Date: Mon, 21 Oct 2024 15:40:07 -0400 Subject: [PATCH] Update GH star script for future run on CI --- components/Nav.tsx | 6 ++++-- package.json | 2 +- scripts/updateGithubStars.ts | 19 +++++++++++++++++++ utils/github.ts | 9 +-------- 4 files changed, 25 insertions(+), 11 deletions(-) create mode 100644 scripts/updateGithubStars.ts diff --git a/components/Nav.tsx b/components/Nav.tsx index 04b7254b2..5c5d92947 100644 --- a/components/Nav.tsx +++ b/components/Nav.tsx @@ -17,7 +17,9 @@ import { productLinks, resourcesLinks } from "./Nav/links"; // Manual count of stars on GitHub for now // Run pnpm run github:stars to get the latest count -const GITHUB_STARS = 2684; +import githubData from "src/data/github.json"; + +const githubStars = githubData.stars; const menu: { title: string; @@ -214,7 +216,7 @@ function OpenSourceButton({ className = "" }: { className?: string }) { > Open Source - {(GITHUB_STARS / 1000).toFixed(1)}K + {(githubStars / 1000).toFixed(1)}K acc + repo.stars, 0); return totalStars; } - -async function main() { - const totalStars = await getTotalStars("inngest"); - console.log(`${totalStars} total stars`); -} - -main();