🐛 fix: ensure single push in CI/CD workflow
All checks were successful
CI/CD Pipeline / Build Docker Cache (push) Successful in 11s
CI/CD Pipeline / CI Pipeline (push) Successful in 4m26s

This commit is contained in:
2026-04-08 16:43:22 +02:00
parent 14a8bc3714
commit 194b2aeb0e
3 changed files with 51 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
#!/bin/bash
# CI script to handle automatic version bumping
# Usage: scripts/ci-version-bump.sh <commit_message>
# Usage: scripts/ci-version-bump.sh <commit_message> [--no-push]
set -e
@@ -11,6 +11,14 @@ fi
LAST_COMMIT=$1
VERSION_BUMPED="false"
NO_PUSH=false
# Parse flags
for arg in "$@"; do
if [ "$arg" = "--no-push" ]; then
NO_PUSH=true
fi
done
# Automatic version bump based on commit type
if echo "$LAST_COMMIT" | grep -q "^✨ feat:"; then
@@ -47,6 +55,13 @@ if [ "$VERSION_BUMPED" = "true" ]; then
git add VERSION cmd/server/main.go README.md
if git commit -m "chore: auto version bump [skip ci]"; then
# Skip push if --no-push flag is set
if [ "$NO_PUSH" = true ]; then
echo "Skipping git push due to --no-push flag"
echo "Successfully bumped version to $NEW_VERSION (committed locally)"
exit 0
fi
# Try push with retry logic for race conditions
for i in 1 2 3; do
if git push; then