Skip to content

ci(workflow): add reusable Discord notification workflow#54

Merged
dialupdisaster merged 4 commits into
mainfrom
feat/discord-webhook-workflow
May 18, 2026
Merged

ci(workflow): add reusable Discord notification workflow#54
dialupdisaster merged 4 commits into
mainfrom
feat/discord-webhook-workflow

Conversation

@dialupdisaster
Copy link
Copy Markdown
Contributor

@dialupdisaster dialupdisaster commented May 18, 2026

Summary

  • add a reusable GitHub Actions workflow that posts Discord embeds for opened issues, opened pull requests, and published releases
  • add a repo-level event wrapper workflow so this repository can exercise the notifier directly
  • document the workflow in the README and add a Discord badge that links to the DEVtheOPS server

Summary by CodeRabbit

  • New Features

    • Automated Discord notifications now triggered on new issues, pull requests, and releases with customizable embed settings.
  • Documentation

    • Added comprehensive guide for configuring Discord webhook integration and notification options.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Warning

Rate limit exceeded

@dialupdisaster has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 52 minutes and 48 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bb1833a8-a922-49b3-a7ce-7b1d2a32d6fb

📥 Commits

Reviewing files that changed from the base of the PR and between 896bcef and 213fe51.

📒 Files selected for processing (3)
  • .github/workflows/discord-events.yml
  • .github/workflows/discord-notify.yml
  • README.md
📝 Walkthrough

Walkthrough

This PR introduces a GitHub→Discord notification system consisting of two new workflows and comprehensive documentation. A reusable workflow (discord-notify.yml) constructs and posts event-tailored Discord embeds via a webhook, while a triggering workflow (discord-events.yml) fires on issue, pull request, and release events and invokes the reusable workflow. The README is updated with feature documentation, badge, and configuration guidance.

Changes

Discord Notifications

Layer / File(s) Summary
Reusable Discord notification workflow
.github/workflows/discord-notify.yml
Reusable workflow defines inputs (Discord username, avatar URL, color, title prefix, body inclusion flag) and required discord_webhook secret. Uses actions/github-script to build event-specific embeds for issues, pull requests, or releases, conditionally truncates bodies, and posts via curl to the Discord webhook.
Event-triggered notification dispatcher
.github/workflows/discord-events.yml
Workflow triggers on issue opened, pull request opened, and release published events, and invokes the reusable discord-notify workflow while passing the DISCORD_WEBHOOK secret.
Documentation and configuration notes
README.md
Added Discord notifications badge and table-of-contents entry, comprehensive feature section describing the reusable workflow interface, event wiring, DISCORD_WEBHOOK secret setup, usage examples for other repos, and workflow input documentation. Also adjusted environment-variable table formatting and added SigNoz region link.

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately summarizes the main change: addition of a reusable Discord notification workflow. It's concise, specific, and clearly conveys the primary purpose of the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/discord-webhook-workflow

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread .github/workflows/discord-events.yml Fixed
@dialupdisaster dialupdisaster force-pushed the feat/discord-webhook-workflow branch from 896bcef to 9bc35d2 Compare May 18, 2026 23:22
@dialupdisaster dialupdisaster changed the title feat(workflows): add reusable Discord notification workflow ci(workflow): add reusable Discord notification workflow May 18, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
README.md (1)

262-262: ⚡ Quick win

Pin the reusable workflow to an immutable ref in the example.

Using @main is mutable; prefer a commit SHA (or a version tag) so consumers don’t pick up unexpected changes.

Proposed fix
-    uses: DEVtheOPS/opencode-plugin-otel/.github/workflows/discord-notify.yml@main
+    uses: DEVtheOPS/opencode-plugin-otel/.github/workflows/discord-notify.yml@<commit-sha>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` at line 262, Update the README example that currently uses the
mutable ref "uses:
DEVtheOPS/opencode-plugin-otel/.github/workflows/discord-notify.yml@main" to pin
the reusable workflow to an immutable ref (e.g., a commit SHA or a released tag
such as `@v1.0.0` or @<commit-sha>); replace the "`@main`" suffix in that uses line
with the chosen immutable ref and optionally include a brief note in the example
explaining that consumers should pin to a SHA or tag to avoid unexpected
changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/discord-events.yml:
- Around line 7-9: The workflow must skip forked pull requests (which lack repo
secrets) while still running for issues, releases, and non-fork PRs; modify the
notification job(s) to only run when the event is not a pull_request or when the
PR head repo is not a fork by adding a job-level if like: github.event_name !=
'pull_request' || github.event.pull_request.head.repo.fork == false (use the
GitHub Actions expression syntax ${{ ... }} in the job's if). Apply the same
conditional to any other notify jobs referenced in the diff (the pull_request
trigger block and the other blocks mentioned around lines 15-18) so forked PRs
are skipped but issues/releases and base-repo PRs still trigger the workflow.

In @.github/workflows/discord-notify.yml:
- Around line 153-156: The curl invocation that posts the Discord webhook (the
command using "$DISCORD_PAYLOAD" and "$DISCORD_WEBHOOK") lacks timeout and retry
flags; update that curl line to add connection and total timeouts and retry
behavior (e.g., include --connect-timeout 10, --max-time 30, --retry 3 and
--retry-delay 2) so the workflow is resilient to transient network/API slowness
while still preserving --fail --silent --show-error and the existing headers and
data.

---

Nitpick comments:
In `@README.md`:
- Line 262: Update the README example that currently uses the mutable ref "uses:
DEVtheOPS/opencode-plugin-otel/.github/workflows/discord-notify.yml@main" to pin
the reusable workflow to an immutable ref (e.g., a commit SHA or a released tag
such as `@v1.0.0` or @<commit-sha>); replace the "`@main`" suffix in that uses line
with the chosen immutable ref and optionally include a brief note in the example
explaining that consumers should pin to a SHA or tag to avoid unexpected
changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e2363684-38b2-4beb-bf3b-17c4c5714874

📥 Commits

Reviewing files that changed from the base of the PR and between c0688a5 and 896bcef.

📒 Files selected for processing (3)
  • .github/workflows/discord-events.yml
  • .github/workflows/discord-notify.yml
  • README.md

Comment thread .github/workflows/discord-events.yml
Comment thread .github/workflows/discord-notify.yml
@dialupdisaster dialupdisaster merged commit 12591a0 into main May 18, 2026
6 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