Skip to content

Commit 29f5fa7

Browse files
author
Shaurya Singh
committed
debug: add logging to github repos endpoint
1 parent e2c0ece commit 29f5fa7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/routes/github-app.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,18 +151,22 @@ export default async function githubAppRoutes(fastify: FastifyInstance) {
151151
try {
152152
// Get user's installation ID
153153
const installationId = await getUserInstallationId(req.userId, db);
154+
console.log('getUserInstallationId result:', { userId: req.userId, installationId });
154155

155156
if (!installationId) {
156157
return reply.status(404).send({ error: 'No GitHub App installation found' });
157158
}
158159

159160
// Get Octokit for this installation
161+
console.log('Getting octokit for installation:', installationId);
160162
const octokit = await getInstallationOctokit(installationId);
161163

162164
// List repositories accessible to this installation
165+
console.log('Fetching repos from GitHub API...');
163166
const { data } = await octokit.rest.apps.listReposAccessibleToInstallation({
164167
per_page: 100,
165168
});
169+
console.log('GitHub API returned:', { total_count: data.total_count, repos_count: data.repositories?.length });
166170

167171
// If available=true, filter out already connected repos
168172
let repos = data.repositories.map((repo: any) => ({

0 commit comments

Comments
 (0)