Skip to content

Add Discord notification workflow for merged pull requests - #989

Merged
sven-n merged 1 commit into
masterfrom
claude/practical-davinci-bsnwab
Sep 27, 2026
Merged

sven-n merged 1 commit into
masterfrom
claude/practical-davinci-bsnwab

Conversation

@sven-n

@sven-n sven-n commented Sep 27, 2026

Copy link
Copy Markdown
Member

Summary

This PR adds a GitHub Actions workflow that automatically sends a notification to Discord whenever a pull request is merged into the repository.

Key Changes

  • Added .github/workflows/discord-merge-notification.yml workflow that:
    • Triggers on pull request merge events using pull_request_target (safe for fork PRs)
    • Constructs a formatted Discord embed message containing PR metadata
    • Posts the notification to a Discord webhook URL via curl
    • Gracefully handles missing webhook configuration with a warning

Implementation Details

  • Uses pull_request_target event type to safely access secrets even for PRs from forks, without checking out or executing PR code
  • Extracts PR information (number, title, author, merge details, target branch) from GitHub event context
  • Builds a JSON payload using jq with:
    • PR title (truncated to 256 characters) as the embed title
    • Author information with avatar
    • Description showing merge details (merged by, target branch, repository)
    • Timestamp of the merge
    • Color code (8540383) for visual consistency
  • Includes error handling to skip notification if the DISCORD_MERGE_WEBHOOK_URL secret is not configured
  • Uses curl with --fail-with-body flag to ensure workflow fails if the webhook request fails

https://claude.ai/code/session_012V7N9f7ciSumzzALxciq51

The webhook URL is read from the DISCORD_MERGE_WEBHOOK_URL repository secret.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012V7N9f7ciSumzzALxciq51
@sven-n
sven-n merged commit bb17089 into master Sep 27, 2026
2 of 3 checks passed
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