Files
dance-lessons-coach/scripts/ci-update-coverage-badge.sh
Gabriel Radureau 5eec64e5e8
All checks were successful
CI/CD Pipeline / Build Docker Cache (push) Successful in 9s
CI/CD Pipeline / CI Pipeline (push) Successful in 4m15s
CI/CD Pipeline / Trigger Docker Push (push) Has been skipped
🧪 test: add JWT secret rotation BDD scenarios and step implementations (#12)
 merge: implement JWT secret rotation with BDD scenario isolation

- Implement JWT secret rotation mechanism (closes #8)
- Add per-scenario state isolation for BDD tests (closes #14)
- Validate password reset workflow via BDD tests (closes #7)
- Fix port conflicts in test validation
- Add state tracer for debugging test execution
- Document BDD isolation strategies in ADR 0025
- Fix PostgreSQL configuration environment variables

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
Co-authored-by: Gabriel Radureau <arcodange@gmail.com>
Co-committed-by: Gabriel Radureau <arcodange@gmail.com>
2026-04-11 17:56:45 +02:00

40 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# KISS coverage badge updater using line numbers
# Usage: scripts/ci-update-coverage-badge.sh <coverage_percentage> [badge_type]
# badge_type: "unit" or "bdd", defaults to "unit"
set -e
COVERAGE=$1
BADGE_TYPE=${2:-"unit"}
# Get first line number of the badge
LINE_NUM=$(cat -n README.md | grep -i "${BADGE_TYPE} coverage" | head -1 | awk '{print $1}')
if [ -z "$LINE_NUM" ]; then
echo "Error: Could not find ${BADGE_TYPE} coverage badge in README.md"
exit 1
fi
# Get color
if (( $(echo "$COVERAGE >= 80" | bc -l) )); then
COLOR="brightgreen"
elif (( $(echo "$COVERAGE >= 50" | bc -l) )); then
COLOR="yellow"
else
COLOR="red"
fi
# Create badge markdown
BADGE_TYPE_UPPER=$(echo "$BADGE_TYPE" | tr '[:lower:]' '[:upper:]')
BADGE_MARKDOWN="[![${BADGE_TYPE_UPPER} Coverage](https://img.shields.io/badge/${BADGE_TYPE_UPPER}_Coverage-${COVERAGE}%-${COLOR}?style=flat-square)](https://gitea.arcodange.lab/arcodange/dance-lessons-coach)"
# Replace the line using sed
if [[ "$(uname)" == "Darwin" ]]; then
sed -i '' "${LINE_NUM}s|.*|${BADGE_MARKDOWN}|" README.md
else
sed -i "${LINE_NUM}s|.*|${BADGE_MARKDOWN}|" README.md
fi
echo "Updated ${BADGE_TYPE} coverage badge to ${COVERAGE}% (line ${LINE_NUM})"