01042bc23c
Nuevas funciones bash: gestión Gitea (create_repo, list_repos, add_collaborator, push_directory), install_android_sdk, install_mantine, frontend_doctor. Pipelines: capacitor_build_apk y gitea_init_app. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1.8 KiB
1.8 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | params | output | tested | tests | test_file_path | file_path | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| gitea_create_repo | function | bash | infra | 1.0.0 | impure | gitea_create_repo(owner: string, name: string, private: string, description: string) -> string | Crea un repositorio en Gitea para un owner. Intenta crearlo en org primero; si el owner no es una org (404/422), lo crea en el usuario autenticado. No falla fatalmente si el repo ya existe (409). |
|
false | error_go_core |
|
JSON del repositorio creado según la API de Gitea | false | bash/functions/infra/gitea_create_repo.sh |
Ejemplo
source bash/functions/infra/gitea_create_repo.sh
export GITEA_URL="https://git.example.com"
export GITEA_TOKEN="$(pass agentes/dataforge-token)"
# Crear repo público en org o usuario
repo_json=$(gitea_create_repo "myorg" "my-app")
# Crear repo privado con descripción
repo_json=$(gitea_create_repo "myorg" "my-app" "true" "Mi aplicación principal")
# Extraer la URL del clon
clone_url=$(echo "$repo_json" | jq -r '.clone_url')
Notas
- Requiere variables de entorno
GITEA_URLyGITEA_TOKENseteadas antes de invocar. - El fallback org → usuario ocurre con HTTP 404 o 422 en el endpoint de orgs.
- Un 409 se reporta a stderr pero la función retorna 0 — el repo ya existe es una condición aceptable para idempotencia.
- Los mensajes informativos van a stderr; el JSON de respuesta va a stdout.