File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,8 +40,14 @@ export function getApp(env: Env) {
4040 } ,
4141 } ) ;
4242
43- app . webhooks . on ( 'issue_comment.created' , async ( data ) => {
44- logger . debug ( 'in comment create' ) ;
43+ // eslint-disable-next-line promise/prefer-await-to-callbacks
44+ app . webhooks . onError ( ( err ) => {
45+ logger . error ( { err } , 'Webhook error' ) ;
46+ } ) ;
47+
48+ // TODO: Swap to create for prod
49+ app . webhooks . on ( 'issue_comment.edited' , async ( data ) => {
50+ logger . debug ( 'in comment edit' ) ;
4551
4652 if ( ! data . payload . comment . body . startsWith ( 'pack this' ) ) {
4753 logger . debug ( `Comment does not start with 'pack this': ${ data . payload . comment . body } ` ) ;
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ const server = {
4444 headers : { 'content-type' : 'application/json' } ,
4545 } ) ;
4646 } catch ( error ) {
47- logger . error ( { error } , 'Error processing webhook' ) ;
47+ logger . error ( { err : error } , 'Error processing webhook' ) ;
4848 return new Response ( 'internal server error' , {
4949 status : 500 ,
5050 headers : { 'content-type' : 'application/json' } ,
You can’t perform that action at this time.
0 commit comments