Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: github status webhooks #27

Merged
merged 1 commit into from
May 26, 2024
Merged

feat: github status webhooks #27

merged 1 commit into from
May 26, 2024

Conversation

danieldietzler
Copy link
Member

No description provided.

@danieldietzler danieldietzler requested review from jrasm91 and bo0tzz May 22, 2024 17:37
@danieldietzler danieldietzler force-pushed the webhooks branch 3 times, most recently from ad14976 to 3373926 Compare May 22, 2024 19:15
src/controllers/webhooks.controller.ts Show resolved Hide resolved
return false;
};

app.post('/github-status', async (req, res) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't just expose a plain endpoint for anyone to be able to post stuff to, so we'll need some way to put a secret in the URL. We can either do that here, or I can try to cook something up on the kubernetes side instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woops that's actually a good point. I was assuming you could just make assumptions about the origin, but it's quite likely that's not easily possible.

Comment on lines +87 to +90
app.use(express.json());
app.use('/webhooks', webhooks);
app.listen(8080, () => {
console.log('Bot listening on port 8080');
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be good to do this before bot.login but it probably doesn't matter. also not a bad idea to listen on a port via env, but also probably doesn't matter

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll move it up real quick, good idea. Keeping the port hard coded should really be fine in this use case imo.

@danieldietzler danieldietzler merged commit 44ea690 into main May 26, 2024
3 checks passed
@danieldietzler danieldietzler deleted the webhooks branch May 26, 2024 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants