mirror of https://github.com/buster-so/buster.git
remove logging statements
This commit is contained in:
parent
d7e3eb5351
commit
6a8c75e59b
|
@ -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,
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue