daaku / axum-github-webhook-extract

A library to secure GitHub Webhooks and extract JSON event payloads in Axum.
MIT License
0 stars 1 forks source link

Support for X-GitHub-Event header #5

Open flying-sheep opened 6 months ago

flying-sheep commented 6 months ago

The event body only contains the action, but not the event type.

Without extracting from that header, the GitHubEvent extractor is less useful. E.g. when the action is “closed”, what was closed? A pull request? A project?

daaku commented 6 months ago

Typed access to the headers would probably be useful. Here's something that might suffice: https://github.com/tokio-rs/axum/discussions/1437

Would be happy to merge contributions if you do end up writing something to help.

flying-sheep commented 6 months ago

Octocrab has this, should be easy to make an extractor: https://docs.rs/octocrab/latest/octocrab/#github-webhook-application-support