Files
fn_registry/bash/functions/infra/gitea_create_webhook.md
T
egutierrez 6b8bcd0939 feat: funciones bash de deploy — rsync_deploy y gitea_create_webhook
rsync_deploy sincroniza directorio local a remoto via SSH con
exclusiones estándar (.git, node_modules, *.db, etc.).
gitea_create_webhook crea webhook de push en un repo Gitea para
auto-deploy en cada commit.
2026-04-12 17:29:56 +02:00

1.6 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_webhook function bash infra 1.0.0 impure gitea_create_webhook(owner: string, repo: string, target_url: string, secret?: string) -> json Crea un webhook de push en un repositorio Gitea. El webhook notifica a target_url en cada push.
gitea
webhook
push
deploy
ci
infra
false error_go_core
name desc
owner usuario u organización propietaria del repositorio
name desc
repo nombre del repositorio
name desc
target_url URL que recibirá el POST del webhook en cada push
name desc
secret secreto compartido para firmar el payload (opcional)
JSON con webhook_id, owner, repo, target_url false
bash/functions/infra/gitea_create_webhook.sh

Ejemplo

source bash/functions/infra/gitea_create_webhook.sh

export GITEA_URL="https://git.example.com"
export GITEA_TOKEN="$(pass agentes/dataforge-token)"

# Crear webhook para auto-deploy
gitea_create_webhook "myorg" "dag_engine" "http://vps:9090/webhook/push" "mi_secreto"
# {"webhook_id":42,"owner":"myorg","repo":"dag_engine","target_url":"http://vps:9090/webhook/push"}

Notas

  • Requiere GITEA_URL y GITEA_TOKEN como variables de entorno.
  • Solo escucha eventos push. Para otros eventos, modificar el array events en el payload.
  • Si el webhook ya existe para la misma URL, Gitea crea uno duplicado (no es idempotente).