Skip to content

Commit 994eb5d

Browse files
committed
fix(webhook): lowercase github repo full_name so cache invalidation matches
GitHub sends repository.full_name with the org's actual casing (TanStack/*), but our libraries config and cache rows use lowercase. The webhook's watch check and markGitHubContentStale/markDocsArtifactsStale calls used strict equality, so every push delivery was silently ignored. Normalize once at the boundary.
1 parent 06932e7 commit 994eb5d

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

src/routes/api/github/webhook.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,14 @@ export const Route = createFileRoute("/api/github/webhook")({
105105
}
106106

107107
const gitRef = payload.ref.replace(/^refs\/heads\//, "");
108+
const repo = payload.repository.full_name.toLowerCase();
108109

109-
if (!isWatchedDocsWebhookSource(payload.repository.full_name, gitRef)) {
110+
if (!isWatchedDocsWebhookSource(repo, gitRef)) {
110111
return Response.json({
111112
ok: true,
112113
ignored: true,
113114
reason: "unwatched repo/ref",
114-
repo: payload.repository.full_name,
115+
repo,
115116
gitRef,
116117
});
117118
}
@@ -127,14 +128,8 @@ export const Route = createFileRoute("/api/github/webhook")({
127128
);
128129

129130
const [staleContentCount, staleArtifactCount] = await Promise.all([
130-
markGitHubContentStale({
131-
repo: payload.repository.full_name,
132-
gitRef,
133-
}),
134-
markDocsArtifactsStale({
135-
repo: payload.repository.full_name,
136-
gitRef,
137-
}),
131+
markGitHubContentStale({ repo, gitRef }),
132+
markDocsArtifactsStale({ repo, gitRef }),
138133
]);
139134

140135
return Response.json({

0 commit comments

Comments
 (0)