Skip to content

Commit 888ad1d

Browse files
authored
chore(sync): merge master into development
2 parents b6a8bbe + 6ff0521 commit 888ad1d

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ jobs:
246246
shell: bash
247247
env:
248248
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
249+
COMMIT_MSG: ${{ github.event.head_commit.message }}
249250
run: |
250251
if [ -z "$DISCORD_WEBHOOK_URL" ]; then
251252
echo "DISCORD_WEBHOOK_URL not configured, skipping."
@@ -283,6 +284,14 @@ jobs:
283284
SHA="${{ github.sha }}"
284285
SHORT_SHA="${SHA:0:7}"
285286
287+
# Discord caps embed field values at 1024 chars. Use only the commit
288+
# subject (first line) and truncate it so the payload is never rejected
289+
# with HTTP 400 on long, multi-line (e.g. squash-merged) messages.
290+
COMMIT_SUBJECT=$(printf '%s' "$COMMIT_MSG" | head -n 1)
291+
if [ "${#COMMIT_SUBJECT}" -gt 256 ]; then
292+
COMMIT_SUBJECT="${COMMIT_SUBJECT:0:253}..."
293+
fi
294+
286295
PAYLOAD=$(jq -n \
287296
--arg title "vMenu (v${DISPLAY_VERSION})" \
288297
--arg desc "$STATUS_TEXT" \
@@ -294,7 +303,7 @@ jobs:
294303
--arg link_url "$LINK_URL" \
295304
--arg short_sha "$SHORT_SHA" \
296305
--arg commit_url "https://github.com/${{ github.repository }}/commit/${{ github.sha }}" \
297-
--arg commit_msg "${{ github.event.head_commit.message }}" \
306+
--arg commit_msg "$COMMIT_SUBJECT" \
298307
'{
299308
embeds: [{
300309
title: $title,

0 commit comments

Comments
 (0)