🤖 feat: implement KISS badge update using environment variables
All checks were successful
CI/CD Pipeline / Build Docker Cache (push) Successful in 9s
CI/CD Pipeline / CI Pipeline (push) Successful in 4m52s

- Fix badge URLs and remove duplicates
- Add update-all-badges.sh script for single commit updates
- Update CI/CD workflow to use environment variables
- Remove complex sequential commit logic
- Follow KISS principle with simple env var approach
This commit is contained in:
2026-04-08 15:21:41 +02:00
parent 1fb15fc331
commit 0b6f18f33c
3 changed files with 90 additions and 16 deletions

50
scripts/update-all-badges.sh Executable file
View File

@@ -0,0 +1,50 @@
#!/bin/bash
# Simple script to update coverage badges in README.md
# Usage: ./scripts/update-all-badges.sh [bdd_coverage] [unit_coverage]
# Both parameters are optional - only updates what's provided
set -e
BDD_COVERAGE=""
UNIT_COVERAGE=""
# Parse arguments (both optional)
if [ -n "$1" ]; then
BDD_COVERAGE=$1
fi
if [ -n "$2" ]; then
UNIT_COVERAGE=$2
fi
echo "🎯 Updating coverage badges..."
if [ -n "$BDD_COVERAGE" ]; then
echo " BDD: ${BDD_COVERAGE}%"
fi
if [ -n "$UNIT_COVERAGE" ]; then
echo " Unit: ${UNIT_COVERAGE}%"
fi
# Update BDD coverage badge if provided
if [ -n "$BDD_COVERAGE" ] && grep -q "BDD_Coverage" README.md; then
sed -i '' "s/BDD_Coverage-[0-9.]\+-%/BDD_Coverage-${BDD_COVERAGE}-%/g" README.md
echo "✅ BDD coverage badge updated to ${BDD_COVERAGE}%"
fi
# Update Unit coverage badge if provided
if [ -n "$UNIT_COVERAGE" ] && grep -q "Unit_Coverage" README.md; then
sed -i '' "s/Unit_Coverage-[0-9.]\+-%/Unit_Coverage-${UNIT_COVERAGE}-%/g" README.md
echo "✅ Unit coverage badge updated to ${UNIT_COVERAGE}%"
fi
# Update main coverage badge if BDD coverage provided
if [ -n "$BDD_COVERAGE" ] && grep -q "coverage-[0-9.]\+-%" README.md; then
sed -i '' "s/coverage-[0-9.]\+-%/coverage-${BDD_COVERAGE}-%/g" README.md
echo "✅ Main coverage badge updated to ${BDD_COVERAGE}%"
fi
if [ -z "$BDD_COVERAGE" ] && [ -z "$UNIT_COVERAGE" ]; then
echo " No coverage values provided - nothing to update"
fi
echo "🎉 Badge update process completed!"