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.
This commit is contained in:
Tam Nhu Tran
2026-03-04 02:24:15 +07:00
parent aa36abbe5e
commit 6e16f1cf3e
+3 -1
View File
@@ -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