discord announcment on release#75
Conversation
📝 WalkthroughWalkthroughAdds a new GitHub composite action ChangesDiscord Notification Action
Sequence DiagramsequenceDiagram
participant GH as GitHub Workflow
participant Action as Notify Discord Composite Action
participant Discord as Discord Webhook
GH->>Action: Invoke with inputs (webhook-url, service-name, version, release-url, release-notes, prerelease, dry-run)
Note over Action: Read env vars, convert flags, truncate notes
alt webhook-url empty
Action->>Action: Log "Discord not configured" and exit (no-op)
else webhook-url present
Action->>Action: Build embed payload (add prerelease prefix if needed)
alt dry-run true
Action->>Action: Log payload JSON and exit
else dry-run false
Action->>Discord: POST embed JSON (10s timeout)
alt HTTP 2xx
Discord->>Action: 2xx response
Action->>GH: Log success with status
else timeout
Action->>GH: Fail with timeout message
else non-2xx
Discord->>Action: Non-2xx + body
Action->>GH: Fail with status and response body
end
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 👉 Get your free trial and get 200 agent minutes per Slack user (a $50 value). Review rate limit: 3/5 reviews remaining, refill in 15 minutes and 39 seconds. Comment |
📚 Skills documentation may need an updateThis PR introduces changes that might not be reflected in the skills documentation. Reason: The PR adds a new public BuildSpace block,
|
📄 README may need an updateThis PR introduces changes that might not be reflected in Reason: README documents
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
README.md (1)
1278-1326: ⚡ Quick winAdd
notify-discordto the Blocks table of contents.The new section is present, but it is not linked from the existing Blocks nav, so readers have to scroll to find it. A single ToC entry would keep the docs discoverable.
📚 Suggested doc update
- [comment-on-pr](`#comment-on-pr`) + - [notify-discord](`#notify-discord`) - [update-docs](`#update-docs`)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` around lines 1278 - 1326, Add a single TOC entry for the new "notify-discord" block in the existing Blocks table of contents pointing to the "notify-discord" section so readers can jump to its docs; update the README's Blocks nav to include a link labeled notify-discord that targets the notify-discord header (the section describing .github/blocks/notify-discord/action.yaml).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/blocks/notify-discord/action.yaml:
- Around line 87-91: The POST to Discord using fetch(webhookUrl, { ..., body:
JSON.stringify(payload) }) can hang indefinitely; wrap the request with an
AbortController-based timeout: create an AbortController, pass controller.signal
into the fetch options, start a setTimeout that calls controller.abort() after a
sensible timeout (e.g. 5–15s), clear the timer after the fetch completes, and
catch the abort/error to fail fast and log/throw appropriately; update the code
around the webhookUrl/payload/response fetch call to use this pattern so stalled
network calls don't pin the workflow.
---
Nitpick comments:
In `@README.md`:
- Around line 1278-1326: Add a single TOC entry for the new "notify-discord"
block in the existing Blocks table of contents pointing to the "notify-discord"
section so readers can jump to its docs; update the README's Blocks nav to
include a link labeled notify-discord that targets the notify-discord header
(the section describing .github/blocks/notify-discord/action.yaml).
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b175ac56-dfc1-45e5-9ce8-8ee07d3789d3
📒 Files selected for processing (2)
.github/blocks/notify-discord/action.yamlREADME.md
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Agent
- GitHub Check: check-readme / check-readme
- GitHub Check: check-skills / check-skills
🧰 Additional context used
🪛 LanguageTool
README.md
[uncategorized] ~1302-~1302: Do not mix variants of the same word (‘pre-release’ and ‘prerelease’) within a single text.
Context: ...the embed as a prerelease (amber color, [Pre-release] title prefix) | | dry-run | boolean...
(EN_WORD_COHERENCY)
There was a problem hiding this comment.
Pull request overview
Adds a new reusable GitHub Actions “block” to announce releases to Discord via a webhook, and documents it in the repository README so it can be easily adopted in release workflows.
Changes:
- Added a composite action block (
notify-discord) that posts a Discord embed for a release (with prerelease styling, truncation, and dry-run support). - Updated README with setup, inputs, and usage example for the new block.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| README.md | Documents the new notify-discord block (setup steps, inputs, usage snippet). |
| .github/blocks/notify-discord/action.yaml | Implements the composite action that sends a release announcement to a Discord webhook. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b463930 to
11511f4
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@README.md`:
- Line 1302: Update the README entry for the `prerelease` input so the wording
is consistent: change the non-literal word “prerelease”/“pre-release” usage to
match one variant while keeping the literal Discord title prefix "[Pre-release]"
exactly as-is; specifically edit the description text for the `prerelease` input
to use the same hyphenation form throughout (e.g., "pre-release" or
"prerelease") and ensure the literal prefix remains "[Pre-release]".
- Around line 1307-1326: The example uses outputs from steps.release-info but
never defines that step; add a preceding step that runs the
generate-release-info block (use:
photon-hq/buildspace/.github/blocks/generate-release-info@main) with id
"release-info" and pass the required inputs (service-name, prerelease,
openai-api-key) so steps.release-info.outputs.version and
steps.release-info.outputs.release_notes are available for the "gh-release" and
"notify-discord" steps; ensure "gh-release" keeps id "gh-release" and
"notify-discord" uses steps.release-info outputs and
steps.gh-release.outputs.url as shown.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 921f330a-dc14-49e7-aaa9-719534b81f4c
📒 Files selected for processing (2)
.github/blocks/notify-discord/action.yamlREADME.md
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/blocks/notify-discord/action.yaml
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: check-skills / check-skills
- GitHub Check: check-readme / check-readme
🧰 Additional context used
🪛 LanguageTool
README.md
[uncategorized] ~1302-~1302: Do not mix variants of the same word (‘pre-release’ and ‘prerelease’) within a single text.
Context: ...the embed as a prerelease (amber color, [Pre-release] title prefix) | | dry-run | boolean...
(EN_WORD_COHERENCY)
Need help on this PR? Tag
@codesmithwith what you need.Summary by CodeRabbit
New Features
Documentation