remove logging statements

This commit is contained in:
Wells Bunker 2025-10-06 15:28:13 -06:00
parent d7e3eb5351
commit 6a8c75e59b
No known key found for this signature in database
GPG Key ID: DB16D6F2679B78FC
2 changed files with 2 additions and 6 deletions

View File

@ -3,7 +3,6 @@ import { HTTPException } from 'hono/http-exception';
import { githubWebhookMiddleware } from '../../../../../middleware/github-webhook-middleware';
const app = new Hono().post('/', githubWebhookMiddleware(), async (c) => {
console.info('GitHub webhook POST');
const githubApp = c.get('githubApp');
if (!githubApp) {
throw new HTTPException(400, {
@ -17,7 +16,7 @@ const app = new Hono().post('/', githubWebhookMiddleware(), async (c) => {
const issue_number = payload.pull_request.number;
const username = payload.pull_request.user.login;
console.info(`Pull request opened by ${username} in ${owner}/${repo}#${issue_number}`);
const body = 'Thank you for your pull request!';
const body = 'Merge if you are stinky!';
return octokit.rest.issues.createComment({
owner,
repo,

View File

@ -26,11 +26,9 @@ function getOrSetApp() {
*/
export function githubWebhookMiddleware(): MiddlewareHandler {
return async (c: Context, next) => {
console.info('GitHub webhook middleware');
try {
const githubApp = getOrSetApp();
c.set('githubApp', githubApp);
console.info('GitHubapp set');
const id = c.req.header('x-github-delivery');
const signature = c.req.header('x-hub-signature-256');
@ -45,13 +43,12 @@ export function githubWebhookMiddleware(): MiddlewareHandler {
await next();
const result = await githubApp.webhooks.verifyAndReceive({
await githubApp.webhooks.verifyAndReceive({
id,
name,
payload,
signature,
});
console.info('GitHub webhook result:', result);
return c.text('Webhook received & verified', 201);
} catch (error) {