chore: add label sync script for org-wide labels

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Snider 2026-02-02 05:14:03 +00:00
parent 9c3ff81787
commit c337c1ae62

43
scripts/sync-labels.sh Executable file
View file

@ -0,0 +1,43 @@
#!/bin/bash
# Sync labels from core-agent to other repos in host-uk org
# Usage: ./sync-labels.sh [repo1] [repo2] ...
# If no repos specified, syncs to all core-* repos
set -e
SOURCE_REPO="host-uk/core-agent"
# Get labels from source
labels=$(gh label list -R "$SOURCE_REPO" --json name,color,description --limit 100)
sync_to_repo() {
local repo=$1
echo "Syncing labels to $repo..."
echo "$labels" | jq -c '.[]' | while read -r label; do
name=$(echo "$label" | jq -r '.name')
color=$(echo "$label" | jq -r '.color')
desc=$(echo "$label" | jq -r '.description')
# Try to create, if exists try to update
if ! gh label create "$name" --color "$color" --description "$desc" -R "$repo" 2>/dev/null; then
gh label edit "$name" --color "$color" --description "$desc" -R "$repo" 2>/dev/null || true
fi
done
echo " Done: $repo"
}
if [ $# -eq 0 ]; then
# Sync to all core-* repos
for repo in host-uk/core-{php,tenant,admin,api,mcp,agentic,bio,social,analytics,notify,trust,support,commerce,content,tools,uptelligence,developer}; do
sync_to_repo "$repo"
done
else
for repo in "$@"; do
sync_to_repo "$repo"
done
fi
echo ""
echo "Label sync complete!"