Badge Setup for Private Repositories
Last Updated: 2025-12-18
Status: Active
ai-dev-kit monorepo (2026-03-30): This repository uses static
img.shields.io/badge/...badges in the root README only; there is noupdate-badges.ymlor orphanshieldsbranch here. See FR-064. The rest of this guide remains useful for adopters who want BYOB with a dedicated public badge repo and explicitrepository/actorin the workflow.
Problem
Private GitHub repositories cannot use standard Shields.io badges because the badge service cannot access private repo data. Badges that rely on GitHub API access (like version badges, build status, etc.) will not render.
Solution: BYOB (Bring Your Own Badge)
We use BYOB to create dynamic badges that work with private repositories by hosting badge metadata in a public repository.
How It Works
- Badge Data Storage: BYOB stores badge data in a JSON file (default:
shields.jsonon ashieldsbranch) - Public Repo Hosting: For private repos, the JSON is stored in a separate public repository
- Badge Generation: The BYOB service (
https://byob.yarr.is/) reads the JSON and generates badges using Badgen - Dynamic Updates: GitHub Actions workflow updates badges automatically when version changes
Setup Instructions
Step 1: Create Public Badge Repository
- Create a new public repository (e.g.,
ai-dev-kit-badges) - The repository can be minimal - it only needs to exist and be public
- Note the repository name format:
{org}/{repo-name}(e.g.,earlution/ai-dev-kit-badges)
Step 2: Create Personal Access Token
- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click "Generate new token (classic)"
- Give it a descriptive name (e.g., "BYOB Badge Updates")
- Select the
reposcope (full control of private repositories) - Click "Generate token"
- Copy the token immediately (you won't be able to see it again)
Step 3: Add Token as Repository Secret
- Go to your private repository (e.g.,
ai-dev-kit) - Navigate to Settings → Secrets and variables → Actions
- Click "New repository secret"
- Name:
BADGES_REPO_TOKEN - Value: Paste your Personal Access Token
- Click "Add secret"
Step 4: Configure Workflow
- Open
.github/workflows/update-badges.yml - Update the
REPOSITORYandACTORvalues in each badge step:REPOSITORY: 'earlution/ai-dev-kit-badges' # Your public repo
ACTOR: 'earlution' # Your GitHub username - Uncomment these lines in all badge steps (version, license, status, tests, coverage, code-quality)
Step 5: Update README Badge URLs
- Open
README.md - Update badge URLs to point to your public badge repo:






Step 6: Test the Workflow
- Make a change to
src/fynd_deals/version.py(or trigger manually) - Push to
mainbranch - Check the Actions tab - the workflow should run
- Verify badges appear in README after workflow completes
Badge Configuration
Current Badges
-
Version Badge
- Updates automatically when version changes
- Extracts version from
src/fynd_deals/version.py - Color: Blue (
007ACC) - Icon: Tag
-
License Badge
- Static: MIT
- Color: Green
- Icon: Scale
-
Status Badge
- Static: Active
- Color: Success (green)
- Icon: Check circle
-
Test Status Badge
- Updates automatically when tests run
- Extracts status from pytest test results
- Status: "passing" (green) or "failing" (red) or "not configured" (grey)
- Color: Success (passing), Critical (failing), Grey (not configured)
- Icon: Check circle
-
Coverage Badge
- Updates automatically when coverage is calculated
- Extracts coverage percentage from pytest-cov output
- Status: Coverage percentage (e.g., "85%") or "not configured"
- Color: Success (≥80%), Important (≥60%), Critical (<60%), Grey (not configured)
- Icon: Shield
-
Code Quality Badge
- Updates automatically when code quality checks run
- Uses ruff (preferred), pylint, or flake8 for linting
- Status: "passing" (green), "warnings" (yellow), "failing" (red), or "not configured" (grey)
- Color: Success (passing), Important (warnings), Critical (failing), Grey (not configured)
- Icon: Code
Adding New Badges
To add a new badge:
-
Add a new step in
.github/workflows/update-badges.yml:- name: Update {badge-name} badge
uses: RubbaBoy/BYOB@v1.3.0
with:
NAME: {badge-name}
LABEL: '{label}'
STATUS: ${{ steps.{step-id}.outputs.{output} }}
COLOR: {hex-color}
ICON: '{icon-name}'
GITHUB_TOKEN: ${{ secrets.BADGES_REPO_TOKEN || secrets.GITHUB_TOKEN }}
REPOSITORY: 'earlution/ai-dev-kit-badges'
ACTOR: 'earlution' -
Add badge to README:

Troubleshooting
Badges Not Rendering
- Check Public Repo: Ensure the public badge repository exists and is public
- Check Token: Verify
BADGES_REPO_TOKENsecret is set correctly - Check Workflow: Verify workflow ran successfully (check Actions tab)
- Check JSON File: Visit
https://github.com/{org}/{badge-repo}/blob/shields/shields.jsonto verify badge data exists - Check URLs: Verify README badge URLs match your public repo name
Test/Coverage Badges Not Updating
- Check Test Framework: Ensure pytest is installed and configured
- Check Test Files: Verify test files exist and are discoverable by pytest
- Check Coverage Tool: Ensure pytest-cov or coverage.py is installed
- Check Workflow Output: Review workflow logs for test/coverage extraction errors
- Check Badge Data: Verify test status and coverage values in badge JSON file
Workflow Fails
- Token Permissions: Ensure token has
reposcope - Repository Name: Verify
REPOSITORYformat isorg/repo-name - Actor Name: Verify
ACTORmatches the token owner's username - Workflow Permissions: Ensure workflow has
contents: writepermission
Badge Data Not Updating
- Check Triggers: Verify workflow triggers on version file changes
- Check Branch: Ensure workflow pushes to
shieldsbranch (default) - Check Path: Verify JSON file path matches BYOB default (
/shields.json)
References
- BYOB Repository: https://github.com/RubbaBoy/BYOB
- BYOB Documentation: See BYOB README for complete usage guide
- Badgen Icons: https://badgen.net/ (for available icon names)
- Workflow File:
.github/workflows/update-badges.yml
Related Work
- Epic: Epic 1 – AI Dev Kit Core
- Story: E1:S06 – Repository CI/CD Setup
- Task: E1:S06:T01 – Set up BYOB badges for private repository
Note: This setup allows badges to work with private repositories by hosting badge metadata in a public repository. The badge data is minimal (just JSON), so there's no security concern with making it public.