ci: Handle NO_COMMITS_TO_BUMP gracefully in bump scripts
When commitizen finds no eligible commits to bump, it exits with code 1 and outputs [NO_COMMITS_TO_BUMP]. This was causing the GitHub Actions workflow to fail even though this is an expected scenario. Updated all three bump scripts (bump-mcp.sh, bump-helm.sh, bump-astrolabe.sh) to: - Detect the [NO_COMMITS_TO_BUMP] message - Exit with code 0 (success) instead of code 1 - Output an informational message instead of an error This allows the bump-version workflow to complete successfully when no version bumps are needed, matching the workflow's existing logic that handles empty BUMPED_COMPONENTS. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -58,6 +58,15 @@ fi
|
||||
# Run commitizen bump and capture output
|
||||
if ! output=$($CZ_CMD 2>&1); then
|
||||
cd ../..
|
||||
|
||||
# Check if this is the expected "no commits to bump" case
|
||||
if echo "$output" | grep -q "\[NO_COMMITS_TO_BUMP\]"; then
|
||||
echo "ℹ️ No commits eligible for version bump" >&2
|
||||
echo "$output" >&2
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Otherwise, this is an actual error
|
||||
echo "❌ Error: Version bump failed" >&2
|
||||
echo "$output" >&2
|
||||
echo "" >&2
|
||||
|
||||
@@ -53,6 +53,15 @@ fi
|
||||
# Run commitizen bump and capture output
|
||||
if ! output=$($CZ_CMD 2>&1); then
|
||||
cd ../..
|
||||
|
||||
# Check if this is the expected "no commits to bump" case
|
||||
if echo "$output" | grep -q "\[NO_COMMITS_TO_BUMP\]"; then
|
||||
echo "ℹ️ No commits eligible for version bump" >&2
|
||||
echo "$output" >&2
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Otherwise, this is an actual error
|
||||
echo "❌ Error: Version bump failed" >&2
|
||||
echo "$output" >&2
|
||||
echo "" >&2
|
||||
|
||||
@@ -44,6 +44,14 @@ fi
|
||||
|
||||
# Run commitizen bump and capture output
|
||||
if ! output=$($CZ_CMD 2>&1); then
|
||||
# Check if this is the expected "no commits to bump" case
|
||||
if echo "$output" | grep -q "\[NO_COMMITS_TO_BUMP\]"; then
|
||||
echo "ℹ️ No commits eligible for version bump" >&2
|
||||
echo "$output" >&2
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Otherwise, this is an actual error
|
||||
echo "❌ Error: Version bump failed" >&2
|
||||
echo "$output" >&2
|
||||
echo "" >&2
|
||||
|
||||
Reference in New Issue
Block a user