Sanitize Discord webhook URL; don't fail release on Discord post#499
Merged
Conversation
The first real release post failed with `curl: (3) URL rejected: Malformed input to a URL function` — the DISCORD_CHANGELOG_WEBHOOK secret carries a trailing newline (captured by `gh secret set` when the value is pasted/piped with one), which curl rejects as a malformed URL. - Strip all whitespace from the webhook value before use. A webhook URL has no internal whitespace, so this is safe and repairs the contaminated secret without needing it re-set. - Make the post non-fatal: the release already shipped before this step, so a Discord failure now logs a ::warning:: annotation and exits 0 instead of turning a successful release red. Also adds curl --retry for transient network blips. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
5e71d2c to
177143b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
What
Fixes the changelog-to-Discord step that failed on its first real release with:
Cause
The
DISCORD_CHANGELOG_WEBHOOKsecret carries a trailing newline —gh secret setkeeps it when the value is pasted/piped with a newline. curl rejects the resulting URL as malformed. (Our local smoke test wrote the URL withprintf '%s', no newline, so it worked — the secret didn't get that treatment.)Fix
::warning::annotation and exits 0 instead of turning a green release red. Addscurl --retry 3for transient blips.Note
The release that surfaced this (the run linked from the failure) shipped fine — only the changelog post was skipped. That one version's note can be posted manually if desired; all future releases post automatically once this merges.
🤖 Generated with Claude Code