Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/api/utils/badge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Badge utilities for GitMCP documentation tracking
*/

const badgeCountAllowedRepos = ["mcp-ui", "git-mcp"];

/**
* Gets a Durable Object stub for the view counter
* @param env Cloudflare environment
Expand Down Expand Up @@ -163,7 +165,12 @@ export function withViewTracking<T, R>(
): (args: T) => Promise<R> {
return async (args: T) => {
// Only track if we have both owner and repo and counter binding available
if (repoData.owner && repoData.repo && env?.VIEW_COUNTER) {
if (
repoData.owner &&
repoData.repo &&
badgeCountAllowedRepos.includes(repoData.repo) &&
env?.VIEW_COUNTER
) {
// Handle the view count tracking
try {
const incrementPromise = incrementRepoViewCount(
Expand Down
Loading