Discord Github PR Notification#259
Merged
Merged
Conversation
namanlp
approved these changes
Mar 18, 2026
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.
Add Discord Notifications for PR Merges
Summary
This PR introduces a GitHub Actions workflow and a lightweight Python script to send notifications to Discord when pull requests are merged.
Motivation
The repository contains multiple target branches (
p1-*,p2-*, …), and PRs may target any of them. Maintaining separate workflows across all branches would be difficult and error-prone.This change centralizes automation in a single place and provides visibility into merge activity via Discord.
Key Design Choices
1. Use of
pull_request_targetThe workflow is triggered using:
This ensures:
main).github/workflowsacross allpX-*branches2. Filter only merged PRs
The
closedevent includes both merged and non-merged PRsFiltering is handled in
scripts/notify.py:3. Python-based notification logic
scripts/notify.py4. Discord Webhook Integration
Uses repository secret:
Sends structured messages (embed format) to the configured Discord channel (
#pr-merges)Features (Initial Scope)
Notify when a PR is merged
Include:
Clean embed-based formatting for readability
Files Added
Testing
Tested via push events on a personal repository
Verified:
Future Improvements
Notifications for:
Label-based routing (e.g., errata vs development)
Multiple Discord channels
Improved formatting (icons, richer embeds)
Notes
pull_request_target(no execution of untrusted PR code)Expected Outcome
Once merged, all future PR merges (to any
pX-*branch) will automatically trigger a Discord notification without requiring additional configuration.