fix(ci): truncate Discord commit field to avoid 400 on long messages#621
Merged
Conversation
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.
Problem
The
Discord Notificationjob failed on the latest master CI/CD run (run 27018095845) with:The build, release, and tag all succeeded (v3.8.14 published fine); only the notification step broke.
Root cause
The "Commit" embed field was built from the full commit message (
github.event.head_commit.message). For the squash-merged commit0df96a4, that message is 975 characters (it includes the entire PR body plus the co-author trailer). Combined with the[`sha`](commit_url) —link prefix (about 96 chars), the field value reached roughly 1071 characters, which exceeds Discord's 1024-character limit for embed field values. Discord rejects the payload with HTTP 400, and curl's-fflag turns that into exit code 22.Fix
COMMIT_MSGenvironment variable instead of interpolating${{ github.event.head_commit.message }}directly into the shell script. The previous direct interpolation would also break the script if a commit subject ever contained a double quote (a latent shell-injection / quoting bug).No other steps were changed.