mapbox / cloudfriend

Helper functions for assembling CloudFormation templates in JavaScript
ISC License
69 stars 9 forks source link

Hookshot: Unable to read X-GitHub-Event header to determine event type #40

Closed davidtheclark closed 6 years ago

davidtheclark commented 6 years ago

I guess it's a suggested "best practice" to determine your GitHub event type by looking at the X-GitHub-Event HTTP header (docs). Instead of duck typing.

This isn't possible in a GH hookshot right now because the HTTP headers are not being passed to your Lambda — only the event body.

Unfortunately, I don't know how we could add that X-GitHub-Event information without a breaking change, since we'd need to change the data structure of the event that the Lambda receives. Any hot ideas?

rclark commented 6 years ago

I guess I'd rather just duck type 🤷‍♂️

The only other reasonable approach would be breaking, yes. If duck-typing isn't enough, then we just break it and include headers & body in the event pushed to the userland Lambda.