EddieHubCommunity / api

API to manage our community data
https://api.eddiehub.io
MIT License
68 stars 63 forks source link

[FEATURE] GitHub events to come in via web hook #280

Closed eddiejaoude closed 2 years ago

eddiejaoude commented 2 years ago

⭐ Suggestion

The GitHub Action to send events to our EddieHub API is not working well with forks.

I just remembered that this might be done better with GitHub webhooks https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads

💻 Use Cases

No response

❌ Related Problems

No response

eddiejaoude commented 2 years ago

Sorry @Cahllagerfeld what do you think?

Cahllagerfeld commented 2 years ago

I never used Webhooks iwth Github, I need to dig into it a bit

eddiejaoude commented 2 years ago

I used it a long time ago, I am happy to pair on it if it helps.

I think the API endpoint will need to be tweaked a bit to accept the data in a slightly different format (IIRC it will just be the top level object fields but everything underneath will be the same)

Cahllagerfeld commented 2 years ago

Do we need to handle authentication for the webhook, or doesn't this matter? My concern is that people can just use the webhook by sending requests there and data gets created

eddiejaoude commented 2 years ago

The web hook on GitHub will be given a token from us to use to send with the data (similar to GitHub secrets), so it will be a protected request https://docs.github.com/en/developers/webhooks-and-events/webhooks/securing-your-webhooks

Cahllagerfeld commented 2 years ago

My Ideas

eddiejaoude commented 2 years ago

Sounds like great ideas 👍