fix: avoid SIGPIPE (exit 141) in release changelog step under pipefail
Some checks failed
Android Build & Publish / android (push) Failing after 11s

This commit is contained in:
Giancarmine Salucci
2026-05-25 09:46:16 +02:00
parent b2a84eb167
commit 3088fa36dc

View File

@@ -158,11 +158,13 @@ jobs:
API="https://git.sal.giize.com/api/v1/repos/mozempk/scopone"
# ── Changelog: commits since last build-* tag (or last 30 commits) ──
LAST_TAG=$(git tag --sort=-creatordate | grep -E '^build-[0-9]+$' | head -1 || true)
# Use grep -m1 instead of | head -1 to avoid SIGPIPE under pipefail.
# Use git log -30 flag instead of | head -30 for the same reason.
LAST_TAG=$(git tag --sort=-creatordate | grep -Em1 '^build-[0-9]+$' || true)
if [[ -n "$LAST_TAG" ]]; then
COMMIT_LOG=$(git log --oneline "${LAST_TAG}..HEAD" 2>/dev/null || git log --oneline | head -30)
COMMIT_LOG=$(git log --oneline -30 "${LAST_TAG}..HEAD" 2>/dev/null || git log --oneline -30)
else
COMMIT_LOG=$(git log --oneline | head -30)
COMMIT_LOG=$(git log --oneline -30)
fi
# Format as a markdown list and JSON-encode for the API body.
MD_LIST=$(echo "$COMMIT_LOG" | sed 's/^/- /')