Add GitHub pull request Discord relay - #62
Merged
Conversation
✅ Deploy Preview for psake ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a Netlify-based relay that receives GitHub pull_request webhooks, validates the X-Hub-Signature-256 HMAC, and forwards only newly opened / ready-for-review PR payloads to a Discord GitHub-compatible webhook. It also wires the new Bun test coverage into the existing Test psake task so the handler contract is exercised in CI.
Changes:
- Add a Netlify function (
github-pr-discord) that filters PR events and forwards the original JSON payload to Discord after signature validation. - Add Bun tests covering the handler’s HTTP contract and forwarding behavior.
- Update the psake
Testtask to run Bun tests before existing Pester tests.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| psakeFile.ps1 | Runs bun test as part of the Test task (and ensures dependencies are installed via Init). |
| netlify/functions/github-pr-discord.ts | Implements the webhook signature validation, PR action filtering, and Discord forwarding logic. |
| netlify/functions/github-pr-discord.test.mjs | Adds Bun tests for the function’s request handling and forwarding behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification
bun test netlify/functions/github-pr-discord.test.mjspwsh ./build.ps1 -Quiet -Task TestFollow-up
Production Netlify secrets and the GitHub organization-webhook payload URL are intentionally not committed and must be configured before cutover.