chore: remove unused GitHub App webhook artifacts#181
Conversation
Greptile SummaryThis PR removes GitHub App webhook artifacts that were left behind after the project settled on GitHub OAuth user tokens instead of GitHub App installation webhooks. No active code paths are affected.
Confidence Score: 5/5Safe to merge — all removed code was either a no-op handler or referenced secrets that are unused by any active route. Every deleted artifact was either a log-and-return webhook handler with no callers, a manual deploy script referencing obsolete secrets, or type/comment declarations for credentials not consumed by any live code path. The retained OAuth secrets and env types remain intact. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "Remove unused GitHub App webhook artifac..." | Re-trigger Greptile |
There was a problem hiding this comment.
Code Review
This pull request removes GitHub App-related components, including the deployment script, the webhook handler, and several environment variables (GITHUB_APP_ID, GITHUB_PRIVATE_KEY, and GITHUB_WEBHOOK_SECRET) from the environment interface and configuration. I have no feedback to provide.
There was a problem hiding this comment.
Pull request overview
Cleans up legacy GitHub App webhook/deployment artifacts that are no longer used now that token collection happens via the GitHub OAuth flow (/api/auth/login + /api/auth/callback) in the Astro SSR app.
Changes:
- Removes the no-op
/webhooks/githubAstro page handler. - Deletes the obsolete
scripts/deploy.shhelper that referenced GitHub App webhook/private-key setup. - Removes unused GitHub App secret typings/comments (
GITHUB_APP_ID,GITHUB_PRIVATE_KEY,GITHUB_WEBHOOK_SECRET) from active web env typing and the rootwrangler.jsoncsecret list (keeps OAuth client secrets).
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
wrangler.jsonc |
Drops obsolete GitHub App webhook/private-key secret comments from the wrangler secret list. |
web/src/pages/webhooks/github.ts |
Deletes an unused, no-op webhook endpoint. |
web/env.d.ts |
Removes unused GitHub App env bindings from the active Cloudflare/Astro runtime typing. |
scripts/deploy.sh |
Removes a stale manual deployment script that referenced obsolete webhook/private-key setup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What changed
web/src/pages/webhooks/github.tshandler.scripts/deploy.shhelper that still asked for GitHub App private-key/webhook setup and advertised/webhooks/github.GITHUB_APP_ID,GITHUB_PRIVATE_KEY, andGITHUB_WEBHOOK_SECRETdeclarations/comments from the active web env typing and root wrangler secret list.GITHUB_CLIENT_IDandGITHUB_CLIENT_SECRET; those are still required by/api/auth/loginand/api/auth/callbackfor GitHub OAuth user-token collection.History
c2f0eb18(init, 2025-12-15) added the original Worker token-manager shape, including the manualscripts/deploy.sh, root wrangler GitHub App secret comments, and a/webhooks/githubroute inworker/routes/misc.ts. That webhook only loggedx-github-eventand returned 200.573b0782(feat: migrate web frontend to Astro SSR, 2025-12-17) addedweb/env.d.tsand carried over both the active OAuth client secrets and the unused GitHub App private-key/webhook secrets.f7fc9576(feat: migrate all routes from Worker to Astro SSR, 2025-12-17) moved token collection to Astro routes and addedweb/src/pages/webhooks/github.ts, but the handler stayed the same no-op log-and-200 behavior./api/auth/loginand/api/auth/callback, which exchanges a GitHub OAuth code withGITHUB_CLIENT_IDandGITHUB_CLIENT_SECRET, then stores the user token in D1. It does not readGITHUB_APP_ID,GITHUB_PRIVATE_KEY, orGITHUB_WEBHOOK_SECRET.Why the webhook is not the OAuth callback
GitHub OAuth redirects users back to
/api/auth/callbackwithcodeandstate; that route validates state, exchanges the code via@octokit/auth-oauth-user, and stores the resulting user token./webhooks/githubis a POST webhook endpoint. It never validates a GitHub webhook signature, never exchanges OAuth codes, never stores tokens, and has no callers in workflows or runtime code.Relationship to #179
This PR deliberately does not touch
worker/index.tsto avoid overlapping with #179, which removes that stale Worker entrypoint entirely. As a result, old type-only GitHub App names still appear insideworker/index.tsuntil #179 lands, but the active wrangler config, active web env typing, no-op webhook route, and obsolete deploy helper are cleaned here.Validation
npm run test:jsnpm run test:shellbunx tsc --noEmitnpm run build -w webgit diff --check