fix(astrolabe): prevent workflow failure when only helm/astrolabe commits exist

When filtering commits with grep -v, if all commits are filtered out,
grep returns exit code 1 which causes the pipeline to fail with set -e.

Wrap grep commands in { ... || true; } to ensure they don't fail the
pipeline when they filter out all results.

This fixes the workflow failure when a fix(astrolabe): commit is pushed
without any MCP server changes.
This commit is contained in:
Chris Coutinho
2025-12-19 21:55:25 +01:00
parent 4c083c7314
commit 3618aed39e
+1 -1
View File
@@ -85,7 +85,7 @@ jobs:
# Count conventional commits that are NOT scoped to helm or astrolabe
mcp_commit_count=$(git log "$commit_range" --oneline --grep="^(feat|fix|docs|refactor|perf|test|build|ci|chore)" -E | \
grep -v "(helm)" | grep -v "(astrolabe)" | wc -l)
{ grep -v "(helm)" || true; } | { grep -v "(astrolabe)" || true; } | wc -l)
if [ "$mcp_commit_count" -gt 0 ]; then
echo "Found $mcp_commit_count commits for MCP server since $last_mcp_tag"