chore: add Claude Code badge with auto-update CI workflow

Adds GitHub Stars badge and "Updated with Claude Code" badge to README.
New workflow auto-updates the Claude Code badge with commit SHA and
timestamp on each push to master/v2-dev.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Shankar
2026-03-30 15:16:09 -04:00
parent 23ac38bef6
commit 149e6a3d0b
2 changed files with 57 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
name: Update Claude Code Badge
on:
push:
branches:
- master
- v2-dev
jobs:
update-badge:
name: Update Claude Code Badge
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update badge with timestamp
run: |
DATE=$(TZ=America/Chicago date +'%b %d, %Y %I:%M %p CST')
SHORT_SHA=$(git rev-parse --short HEAD)
BADGE_TEXT="Updated_with-Claude_Code_${SHORT_SHA}_(${DATE})-D97757"
# URL-encode spaces and special chars
BADGE_TEXT=$(echo "$BADGE_TEXT" | sed 's/ /%20/g; s/,/%2C/g; s/:/%3A/g; s/(/%28/g; s/)/%29/g')
BADGE_MD="[![Updated with Claude Code](https://img.shields.io/badge/${BADGE_TEXT}?style=flat\&logo=claude\&logoColor=white)](https://claude.ai/code)"
# Replace between markers
sed -i '/<!-- CLAUDE_CODE_BADGE:START -->/,/<!-- CLAUDE_CODE_BADGE:END -->/{
/<!-- CLAUDE_CODE_BADGE:START -->/!{
/<!-- CLAUDE_CODE_BADGE:END -->/!d
}
}' README.md
sed -i "/<!-- CLAUDE_CODE_BADGE:START -->/a ${BADGE_MD}" README.md
- name: Check for changes
id: changes
run: |
if git diff --quiet README.md; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Commit and push
if: steps.changes.outputs.changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add README.md
git commit -m "chore: update Claude Code badge [skip ci]"
git push
+4
View File
@@ -25,6 +25,10 @@ certctl is a self-hosted platform that automates the entire certificate lifecycl
[![License](https://img.shields.io/badge/license-BSL%201.1-blue.svg)](LICENSE)
[![Go Report Card](https://goreportcard.com/badge/github.com/shankar0123/certctl)](https://goreportcard.com/report/github.com/shankar0123/certctl)
[![GitHub Release](https://img.shields.io/github/v/release/shankar0123/certctl)](https://github.com/shankar0123/certctl/releases)
[![GitHub Stars](https://img.shields.io/github/stars/shankar0123/certctl?style=flat&logo=github)](https://github.com/shankar0123/certctl/stargazers)
<!-- CLAUDE_CODE_BADGE:START -->
[![Updated with Claude Code](https://img.shields.io/badge/Updated_with-Claude_Code-D97757?style=flat&logo=claude&logoColor=white)](https://claude.ai/code)
<!-- CLAUDE_CODE_BADGE:END -->
## Documentation