GitHub SNS Integration not sending "delete" event

Hey all,

I’m using the SNS integration to react to pull_request events with Lambda (namely, deleting CFN stacks). I wanted to add support for invoking a Lambda function when deleting a branch, but apparently, the delete event doesn’t reach SNS at all.

Any idea why?

Thanks,

Nir

Hey Nir :wave: The SNS service defaults to only sending push events. It sounds like you’ve already changed that to picking up pull_request events as well, so much of this may be review for you. The gist is that branch deletions are a separate event from the pull_request events, so you’d need to make sure that you’re triggering those delete events as well.

You can see a description of these events here:

http://developer.github.com/webhooks/

The only way to update a service to listen on different events is to use the API (it’s not possible to do it via the UI):

https://developer.github.com/v3/repos/hooks/#edit-a-hook

So, you can fetch the list of services and webhooks in that repository:

https://developer.github.com/v3/repos/hooks/#list-hooks

And then use this endpoint to edit the list of events:

https://developer.github.com/v3/repos/hooks/#edit-a-hook

If you’ve already added the delete events and it’s still not working:

If that’s the case, can you please write in to github.com/contact with more details about which repository this is so we can check our logs for you? Thanks!

1 Like

When configuring the SNS service to listen for deployment events, the integration starts failing with

"last\_response": {  
"code": 500,  
"status": "hookshot\_error",  
"message": "ERROR"  
}  

and I do not receive any requests to my SNS topic. Does the SNS service integration only support push events?

Hi @rsullivan00,

In order for us to help you further with this, can you actually write us at git.io/c? When doing so, please include the organization or repository you’ve setup the service hook on. You can also reference this forum thread when writing to private support to provide full context for your question.

Cheers!