Docs: Phoenix TTS contract, recommendations (TTS/Gitea/Phoenix), push-all note, Gitea labels for virtual-banker
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
53
scripts/dev-vm/apply-gitea-labels.sh
Executable file
53
scripts/dev-vm/apply-gitea-labels.sh
Executable file
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env bash
|
||||
# Create org-level labels and optionally apply to repos per GITEA_ORG_STRUCTURE.md
|
||||
# Usage: GITEA_TOKEN=xxx bash apply-gitea-labels.sh [--apply-to-repos]
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
[ -f "$PROJECT_ROOT/.env" ] && set +u && source "$PROJECT_ROOT/.env" 2>/dev/null || true && set -u
|
||||
|
||||
GITEA_URL="${GITEA_URL:-https://gitea.d-bis.org}"
|
||||
GITEA_TOKEN="${GITEA_TOKEN:-}"
|
||||
GITEA_ORG="${GITEA_ORG:-d-bis}"
|
||||
APPLY_TO_REPOS=false
|
||||
[[ "${1:-}" == "--apply-to-repos" ]] && APPLY_TO_REPOS=true
|
||||
|
||||
# Labels from GITEA_ORG_STRUCTURE.md (project/domain)
|
||||
LABELS=(
|
||||
"project/sankofa:#7057ff"
|
||||
"project/omnis:#cfd3d7"
|
||||
"project/proxmox:#bfd4f2"
|
||||
"project/dbis_core:#fef2c0"
|
||||
"project/chain138:#0e8a16"
|
||||
"project/explorer:#fbca04"
|
||||
"project/miracles_in_motion:#d93f0b"
|
||||
"project/the_order:#c2e0c6"
|
||||
"project/virtual-banker:#c2e0c6"
|
||||
"domain/blockchain:#1d76db"
|
||||
"domain/web:#5319e7"
|
||||
"domain/infrastructure:#0e8a16"
|
||||
"domain/api:#c5def5"
|
||||
)
|
||||
|
||||
if [ -z "$GITEA_TOKEN" ]; then
|
||||
echo "Set GITEA_TOKEN"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
API="${GITEA_URL%/}/api/v1"
|
||||
AUTH="Authorization: token $GITEA_TOKEN"
|
||||
|
||||
# Create org-level labels (Gitea API: POST /orgs/{org}/labels)
|
||||
for entry in "${LABELS[@]}"; do
|
||||
name="${entry%%:*}"
|
||||
color="${entry##*:}"
|
||||
color="${color#\#}"
|
||||
echo "Creating label: $name"
|
||||
curl -sSf -X POST "$API/orgs/$GITEA_ORG/labels" \
|
||||
-H "$AUTH" -H "Content-Type: application/json" \
|
||||
-d "{\"name\":\"$name\",\"color\":\"$color\"}" 2>/dev/null || echo " (may already exist)"
|
||||
done
|
||||
|
||||
echo "Labels created. Add them to repos via Gitea UI: Repo → Settings → Labels"
|
||||
Reference in New Issue
Block a user