Files
dance-lessons-coach/scripts/update-all-badges.sh
Gabriel Radureau 0b6f18f33c
All checks were successful
CI/CD Pipeline / Build Docker Cache (push) Successful in 9s
CI/CD Pipeline / CI Pipeline (push) Successful in 4m52s
🤖 feat: implement KISS badge update using environment variables
- 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
2026-04-08 15:21:41 +02:00

51 lines
1.5 KiB
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/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!"