diff --git a/README.md b/README.md index bd72a04..d94909f 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ [![Go Report Card](https://goreportcard.com/badge/github.com/arcodange/dance-lessons-coach)](https://goreportcard.com/report/github.com/arcodange/dance-lessons-coach) [![Version](https://img.shields.io/badge/version-1.4.0-blue.svg)](https://gitea.arcodange.fr/arcodange/dance-lessons-coach/releases) [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE) -[![Unit Coverage](https://img.shields.io/badge/Unit_Coverage-8.4%-red?style=flat-square)](https://gitea.arcodange.lab/arcodange/dance-lessons-coach) [![BDD Coverage](https://img.shields.io/badge/BDD_Coverage-55.9%-yellow?style=flat-square)](https://gitea.arcodange.lab/arcodange/dance-lessons-coach) +[![Unit Coverage](https://img.shields.io/badge/Unit_Coverage-8.4%-red?style=flat-square)](https://gitea.arcodange.lab/arcodange/dance-lessons-coach) A Go project demonstrating idiomatic package structure, CLI implementation, and JSON API with Chi router. ======= diff --git a/scripts/ci-update-coverage-badge.sh b/scripts/ci-update-coverage-badge.sh index a11315e..7be7477 100755 --- a/scripts/ci-update-coverage-badge.sh +++ b/scripts/ci-update-coverage-badge.sh @@ -69,6 +69,20 @@ if grep -q "${BADGE_TYPE}_Coverage-${COVERAGE}%" README.md || grep -q "coverage- exit 0 fi +# Also check if badge already exists with this coverage (more flexible pattern) +if [ "$BADGE_TYPE" = "bdd" ] || [ "$BADGE_TYPE" = "unit" ]; then + # Capitalize first letter for badge name + if [ "$BADGE_TYPE" = "unit" ]; then + BADGE_NAME="Unit" + else + BADGE_NAME="BDD" + fi + if grep -q "\[!\[${BADGE_NAME} Coverage\].*${COVERAGE}%" README.md; then + echo "Coverage badge already exists at ${COVERAGE}%" + exit 0 + fi +fi + # Cross-platform sed command # Detect if we're on macOS (BSD sed) or Linux (GNU sed) SED_CMD=""