Forward GitHub release events to Discord - #65
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 extends the existing Netlify GitHub→Discord relay to also forward GitHub release webhook events (in addition to the already-supported filtered pull_request actions), while keeping the forwarded payload raw and setting the forwarded X-GitHub-Event header appropriately for Discord’s GitHub-compatible endpoint.
Changes:
- Expand the Netlify function’s event handling to forward
releaseevents in addition to eligiblepull_requestevents. - Forward the event type via
X-GitHub-Eventbased on the accepted incoming event (pull_requestvsrelease). - Update tests to cover forwarding of
releaseevents and to reflect the broader relay scope.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/github-pr-discord.test.mjs | Renames the suite and adds coverage ensuring release events are forwarded unchanged (raw payload + X-GitHub-Event: release). |
| netlify/functions/github-pr-discord.ts | Generalizes the handler to forward authenticated release deliveries in addition to the existing allowed pull_request actions, and sets the forwarded event header accordingly. |
💡 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
releasewebhook events through the existing authenticated Netlify relayVerification
bun test tests/github-pr-discord.test.mjspwsh ./build.ps1 -Quiet -Task Testnetlify functions:build --src netlify/functions --functions /tmp/psake-release-functionsThe existing organization webhook is already subscribed to Releases; merge/deploy is the remaining configuration step.