fix: avoid SIGPIPE (exit 141) in release changelog step under pipefail
Some checks failed
Android Build & Publish / android (push) Failing after 11s
Some checks failed
Android Build & Publish / android (push) Failing after 11s
This commit is contained in:
@@ -158,11 +158,13 @@ jobs:
|
|||||||
API="https://git.sal.giize.com/api/v1/repos/mozempk/scopone"
|
API="https://git.sal.giize.com/api/v1/repos/mozempk/scopone"
|
||||||
|
|
||||||
# ── Changelog: commits since last build-* tag (or last 30 commits) ──
|
# ── 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
|
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
|
else
|
||||||
COMMIT_LOG=$(git log --oneline | head -30)
|
COMMIT_LOG=$(git log --oneline -30)
|
||||||
fi
|
fi
|
||||||
# Format as a markdown list and JSON-encode for the API body.
|
# Format as a markdown list and JSON-encode for the API body.
|
||||||
MD_LIST=$(echo "$COMMIT_LOG" | sed 's/^/- /')
|
MD_LIST=$(echo "$COMMIT_LOG" | sed 's/^/- /')
|
||||||
|
|||||||
Reference in New Issue
Block a user