From 6e16f1cf3e2a3d43fa600a6fbadd35a513bf5db7 Mon Sep 17 00:00:00 2001 From: Tam Nhu Tran Date: Wed, 4 Mar 2026 02:22:10 +0700 Subject: [PATCH] fix(ci): strip ANSI codes before detecting published release semantic-release outputs ANSI color codes that break the grep pattern for detecting "Published GitHub release", causing Discord notifications to be skipped even on successful releases. --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8d44855a..caaaed21 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -59,7 +59,9 @@ jobs: run: | OUTPUT=$(bunx semantic-release 2>&1) || true echo "$OUTPUT" - if echo "$OUTPUT" | grep -q "Published release"; then + # Strip ANSI color codes before matching (semantic-release outputs colored text) + CLEAN=$(echo "$OUTPUT" | sed 's/\x1b\[[0-9;]*m//g') + if echo "$CLEAN" | grep -q "Published GitHub release"; then echo "released=true" >> $GITHUB_OUTPUT else echo "released=false" >> $GITHUB_OUTPUT