Skip to content

Add GitHub pull request Discord relay - #62

Merged
HeyItsGilbert merged 3 commits into
mainfrom
feat/github-pr-discord-relay
Aug 30, 2026
Merged

Add GitHub pull request Discord relay#62
HeyItsGilbert merged 3 commits into
mainfrom
feat/github-pr-discord-relay

Conversation

@HeyItsGilbert

Copy link
Copy Markdown
Member

Summary

  • add a Netlify Function that validates GitHub webhook signatures and forwards only newly opened or ready-for-review pull requests to Discord
  • retain the raw GitHub payload and GitHub-compatible Discord webhook presentation
  • cover the HTTP handler contract with Bun tests and run them through the existing Test task

Verification

  • bun test netlify/functions/github-pr-discord.test.mjs
  • pwsh ./build.ps1 -Quiet -Task Test

Follow-up

Production Netlify secrets and the GitHub organization-webhook payload URL are intentionally not committed and must be configured before cutover.

Copilot AI lite review requested due to automatic review settings August 30, 2026 00:38
@netlify

netlify Bot commented Aug 30, 2026

Copy link
Copy Markdown

Deploy Preview for psake ready!

Name Link
🔨 Latest commit 82f22b8
🔍 Latest deploy log https://app.netlify.com/projects/psake/deploys/6a937d02d730da00088596aa
😎 Deploy Preview https://deploy-preview-62--psake.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 Test task 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.

Comment thread netlify/functions/github-pr-discord.ts
@HeyItsGilbert
HeyItsGilbert merged commit 6a10148 into main Aug 30, 2026
10 checks passed
@HeyItsGilbert
HeyItsGilbert deleted the feat/github-pr-discord-relay branch August 30, 2026 01:02
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.

2 participants