Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,18 @@ jobs:
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"

# Fetch the badges branch or create it as an orphan
git fetch origin badges:badges 2>/dev/null || git checkout --orphan badges
git checkout badges
# Always start fresh with orphan branch
git checkout --orphan badges-temp
git rm -rf . 2>/dev/null || true

# Create badge directory and file
mkdir -p .github/badges
cat > README.md << 'EOF'
# Coverage Badges

This branch stores dynamically generated coverage badges.
EOF

python -c "
import os, json
coverage = float(os.environ['COVERAGE'])
Expand All @@ -74,6 +80,6 @@ jobs:
json.dump(badge, f)
"

git add .github/badges/coverage.json
git diff --staged --quiet || git commit -m "Update coverage badge [skip ci]"
git push origin badges
git add .
git commit -m "Update coverage badge to ${COVERAGE}% [skip ci]"
Copy link

Copilot AI Jan 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit message uses variable interpolation syntax ${COVERAGE} but it's inside single quotes in the git commit command, which prevents shell variable expansion. The commit message will literally contain the string "${COVERAGE}%" instead of the actual coverage percentage value. Either use double quotes around the entire message or use "Update coverage badge to $COVERAGE% [skip ci]" to ensure proper variable expansion.

Copilot uses AI. Check for mistakes.
git push -f origin badges-temp:badges
Loading