Webhook GitHub — PRs, Issues e CI/CD

Webhook: GitHub

Receba notificações do GitHub diretamente no seu chat.

O Que Você Recebe

  • Pull Requests - Abertos, mergeados, comentários
  • Issues - Criadas, fechadas, comentários
  • Deploys - Status de deployment
  • CI/CD - Resultado de workflows
  • Releases - Novas versões
  • Stars - Novos stars no repo

Configuração

1. No GitHub

  1. Vá em Settings > Webhooks do repo
  2. Clique Add webhook
  3. Configure:
    • URL: https://seu-servidor/webhooks/github
    • Content type: application/json
    • Secret: [gere um secret seguro]
    • Events: Selecione os desejados

2. No OpenClaw

# config.yaml
webhooks:
  github:
    enabled: true
    secret: "seu-webhook-secret"
    repos:
      - owner/repo1
      - owner/repo2

3. Reiniciar

openclaw gateway restart

Eventos Recomendados

Para Desenvolvedores

  • push - Commits
  • pull_request - PRs
  • pull_request_review - Reviews
  • issues - Issues
  • issue_comment - Comentários

Para DevOps

  • workflow_run - CI/CD
  • deployment - Deploys
  • deployment_status - Status

Para Maintainers

  • star - Stars
  • fork - Forks
  • release - Releases

Exemplos de Alertas

Novo PR

 NOVO PULL REQUEST

#142 - Implementa feature X
 org/repo
 @maria

+234 -45 (8 arquivos)

Descrição:
Esta PR implementa a feature X
conforme issue #120...

 Ver PR

CI Falhou

Não CI FALHOU

Workflow: Tests
Branch: feature/nova-feature
Commit: abc123 "Adiciona testes"
 @pedro

Erro: Test failed in user_test.go:45

 Ver logs

PR Mergeado

Sim PR MERGEADO

#142 - Implementa feature X
 org/repo
 Mergeado por @diego

Branch: feature/x → main

 Ver commit

Deploy

 DEPLOY CONCLUÍDO

Ambiente: production
Versão: v2.3.0
Commit: abc123
 @diego

Status: Sim Sucesso
Duração: 2m 34s

 Ver deployment

Automações

Notificação de PR para Review

Quando PR for aberto com reviewer @diego:
- Notifique imediatamente
- Inclua resumo do PR

Alerta de CI

Quando workflow falhar na main:
- Alerta urgente
- Inclua logs relevantes
- Sugira ações

Release Notes

Quando release for publicada:
- Notifique no Slack #releases
- Envie changelog para stakeholders

Star Milestone

Quando repo atingir múltiplo de 100 stars:
- Celebre! 
- Tweet automático (opcional)

Filtros

Por Repo

webhooks:
  github:
    filters:
      repos:
        - "minha-org/repo-importante"

Por Branch

webhooks:
  github:
    filters:
      branches:
        - "main"
        - "develop"

Por Autor

webhooks:
  github:
    filters:
      ignore_authors:
        - "dependabot[bot]"
        - "github-actions[bot]"

Segurança

Validar Assinatura

O OpenClaw valida automaticamente o X-Hub-Signature-256.

HTTPS

Sempre use HTTPS em produção.

IP Allowlist (Opcional)

GitHub IPs: docs.github.com/webhooks

Próximos Passos