Skip to content

fix(notify): support cf-discord-relay routing with direct-webhook fallback (#6) - #7

Merged
Synertry merged 1 commit into
releasefrom
main
Jun 9, 2026
Merged

fix(notify): support cf-discord-relay routing with direct-webhook fallback (#6)#7
Synertry merged 1 commit into
releasefrom
main

Conversation

@Synertry

@Synertry Synertry commented Jun 9, 2026

Copy link
Copy Markdown
Owner

The previous notify.yaml POSTed straight to DISCORD_WEBHOOK_URL, which
fails 401 when the URL points at a cf-discord-relay deployment (the
relay requires an x-auth-key header). Adopts the pattern from
cf-discord-relay's own notify.yaml:

  • DISCORD_WEBHOOK_URL stays the DIRECT Discord webhook URL, no relay-
    specific form. The relay URL is synthesized at runtime by stripping
    the Discord host + /api/ prefix and prepending the relay domain.
  • New optional secrets DISCORD_RELAY_AUTH_KEY + DISCORD_RELAY_CUSTOM_DOMAIN.
    When both are set, the embed is posted via the relay first. If the
    relay returns non-2xx, the workflow falls back to the direct Discord
    webhook so a relay outage does not lose the notification.
  • Names carry the DISCORD_RELAY_ prefix since this repo is external to
    cf-discord-relay and the secrets need context to be self-documenting.

Also tightens the embed building:

  • truncate_str helper applies Discord's per-element character limits
    (title 256, description 4096, field value 1024) so a long release
    body cannot cause Discord to reject the payload.
  • Inputs flow through env: instead of direct ${{ }} interpolation so a
    crafted tag string cannot inject into the run script.
  • set -euo pipefail + --fail-with-body so failures surface in the Actions
    UI instead of silently going missing.

Signed-off-by: Synertry 60792595+Synertry@users.noreply.github.com

…lback (#6)

The previous notify.yaml POSTed straight to DISCORD_WEBHOOK_URL, which
fails 401 when the URL points at a cf-discord-relay deployment (the
relay requires an x-auth-key header). Adopts the pattern from
cf-discord-relay's own notify.yaml:

- DISCORD_WEBHOOK_URL stays the DIRECT Discord webhook URL, no relay-
  specific form. The relay URL is synthesized at runtime by stripping
  the Discord host + /api/ prefix and prepending the relay domain.
- New optional secrets DISCORD_RELAY_AUTH_KEY + DISCORD_RELAY_CUSTOM_DOMAIN.
  When both are set, the embed is posted via the relay first. If the
  relay returns non-2xx, the workflow falls back to the direct Discord
  webhook so a relay outage does not lose the notification.
- Names carry the DISCORD_RELAY_ prefix since this repo is external to
  cf-discord-relay and the secrets need context to be self-documenting.

Also tightens the embed building:

- truncate_str helper applies Discord's per-element character limits
  (title 256, description 4096, field value 1024) so a long release
  body cannot cause Discord to reject the payload.
- Inputs flow through env: instead of direct ${{ }} interpolation so a
  crafted tag string cannot inject into the run script.
- set -euo pipefail + --fail-with-body so failures surface in the Actions
  UI instead of silently going missing.

Signed-off-by: Synertry <60792595+Synertry@users.noreply.github.com>
@Synertry Synertry added the workflow/auto-pr Pull request opened by an automated workflow label Jun 9, 2026
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Release Candidate Summary

Automation report for review before merging into release.

Statistics

  • Commits: 1
  • Files Changed: 1

Changed Files

Click to expand file list
M	.github/workflows/notify.yaml

Commit History

Click to expand commit log

Generated by GitHub Actions for Release Verification

@github-actions github-actions Bot added status/review-needed Requires human review before merging status/approval-pending Waiting on approver before fast-forward to release area/CI GitHub workflows, Dependabot, labelers, scripts size/s Small diff (< 150 lines, 10 files) and removed status/review-needed Requires human review before merging labels Jun 9, 2026
@Synertry

Synertry commented Jun 9, 2026

Copy link
Copy Markdown
Owner Author

/approve

@Synertry
Synertry merged commit e94f71d into release Jun 9, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/CI GitHub workflows, Dependabot, labelers, scripts size/s Small diff (< 150 lines, 10 files) status/approval-pending Waiting on approver before fast-forward to release workflow/auto-pr Pull request opened by an automated workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants