Pular para o conteúdo

Receba mensagens no Slack quando seu repo no GitHub ganhar estrelas

Ver no idioma original →

Autoria: n8n · Assistir no YouTube

Vídeo de autoria do canal indicado, não da IANIA; todos os direitos pertencem ao criador. Transcrição, resumo e tradução gerados automaticamente; o conteúdo no idioma original é preservado na versão em idioma original.

Idioma original: inglês

Vídeo original: Get Slack messages for New GitHub Stars · Canal: n8n · 03:07 · Assistir no YouTube

Tópicos: Automação de tarefas e workflows, Ferramentas de desenvolvimento com IA

O vídeo mostra como criar, com o n8n Assistant, um workflow que envia uma mensagem no Slack quando alguém dá estrela a um repo no GitHub. O workflow tem três nodes e exige configurar conexões com GitHub e Slack. Para enviar a notificação por um bot, o apresentador configura manualmente um token de acesso do Slack. Depois de testar e publicar o workflow, ele confirma que a notificação chega ao Slack.

  • O n8n Assistant cria um workflow a partir de uma descrição em linguagem natural.
  • O exemplo envia uma notificação no Slack quando o repo indieartifacts recebe uma estrela no GitHub.
  • O workflow criado tem três nodes.
  • A conexão com o GitHub é configurada com um clique no n8n Cloud.
  • No Slack, o apresentador configura um token de acesso de um bot para que as mensagens não venham da própria conta.
  • O workflow é testado antes de ser publicado.
  • Após a publicação, uma nova estrela no repo gera uma mensagem no Slack.
Início Capítulo Resumo
00:00 Criando o workflow de notificação O apresentador pede ao n8n Assistant uma notificação no Slack quando alguém der estrela ao repo no GitHub.
01:01 Configurando as conexões Ele examina o workflow de três nodes e conecta o GitHub e o Slack, usando um token de bot no Slack.
02:05 Testando a mensagem no Slack Depois de salvar a configuração do bot, ele testa o workflow e confirma que recebeu uma notificação.
02:37 Publicando e confirmando o workflow O workflow é publicado e o apresentador explica que uma nova estrela deverá gerar outra notificação.

Estou cansado de ficar olhando para ele, só esperando receber estrelas. — 00:00

Quero uma notificação no Slack quando alguém der estrela ao meu repo no GitHub. — 00:31

Agora funciona. — 02:37

Talvez, quando eu receber minha terceira estrela, eu fique sabendo na hora. — 03:07

  • n8n Assistant (ferramenta): Assistente integrado ao n8n usado para criar workflows a partir de instruções.
  • n8n (ferramenta): Plataforma usada no vídeo para criar e publicar o workflow de notificação.
  • GitHub (ferramenta): Plataforma cuja atividade de estrelas no repo aciona a notificação.
  • Slack (ferramenta): Plataforma em que o workflow envia uma mensagem quando o repo recebe uma estrela.
  • liammcgarigal/indieartifacts (repo): Repo do GitHub usado como exemplo no workflow.
  • n8n Cloud (ferramenta): Solução hospedada do n8n mencionada como opção para conectar ao GitHub com um clique.

00:00 Acabei de lançar este projeto no GitHub outro dia e, sinceramente, estou cansado de ficar olhando para ele, só esperando receber estrelas. Então decidi configurar uma notificação no Slack para quando alguém der uma estrela. É isso que vamos fazer neste vídeo. Estou criando isso no Assistente do n8n, que é o construtor de agents integrado do n8n. Você pode acessá-lo por este botão aqui. Vou criar isso no meu projeto superlegal. Projeto? Acho que conta. E aqui, basta dizer o que você quer. Então, você pode escrever algo como: quero uma notificação no Slack quando alguém der uma estrela no meu

00:31 repo do GitHub, e vou colar meu ID do Slack. E o repo é liammcgarigal/indieartifacts. Quero que a mensagem seja algo simples, como “nova estrela de nome de usuário”, com um emoji de estrela. E podemos enviar isso, e ele deve começar a criar. Este é um projeto novo, então não há nenhuma conexão configurada. Por isso, provavelmente ele vai criar um workflow bem simples, já que este é um caso de uso bem simples, e pedir que eu informe uma conexão com o GitHub e uma com o Slack. Podemos ver aqui todas as coisas em que ele está trabalhando.

01:01 Também podemos expandir isso e ver as skills e todas as coisas que ele está fazendo nos bastidores. Mas, sabe, podemos fazer isso por conta própria, se quisermos pensar em tudo. Vamos fechar isto. Levou 36 segundos e já temos nosso workflow simples aqui. Ele tem apenas três nós para quando chega uma nova estrela. Está pedindo que configuremos o GitHub. Como estou no N8nCloud, nossa solução hospedada, basta um clique para fazer a conexão. Se você estiver usando a edição gratuita auto-hospedada, terá acesso a tudo isso. Você só precisa trazer sua própria chave de API para a IA e configurá-la manualmente, o que significa que precisa acessar o GitHub e obter uma chave de API,

01:34 mas posso simplesmente clicar, e ele se conecta assim. Agora temos o Slack. Poderíamos conectar com um clique também, mas isso daria acesso à nossa própria conta de usuário. Então, ele enviaria mensagens como se fosse eu, liam mcgarigal, o que não é muito bom, porque aí eu receberia uma mensagem direta de mim mesmo e não receberia uma notificação. Quero que a mensagem venha de uma conta de bot, então vamos configurá-la manualmente. Vamos até o token de acesso. Eu já tinha copiado meu token de acesso para não precisar mostrá-lo no vídeo para todo mundo, mas vou colá-lo ali. Este é apenas um bot que configurei no Slack

02:05 anteriormente. Não é tão difícil; basta seguir as instruções. Se estiver com problemas, você pode consultar a documentação aqui. Mas vou salvar isso e clicar em aplicar. Então, ele deve adicionar a conexão. E parece que os pequenos itens ainda estão aqui. Já percebi que, se você simplesmente abrir e fechar, ele acaba atualizando. Ainda é um rascunho não publicado. Agora vou dizer: “Vamos testar de verdade e ver se recebo uma mensagem direta.” Certo, ele pergunta. Vou dizer para sempre permitir.

02:37 Legal. Agora vamos conferir o Slack: recebemos uma nova estrela. Então, vamos fazer uma coisinha assim. E agora funciona. É claro que podemos simplesmente clicar em publicar aqui, mas não sei mais fazer nada sozinho. Então vou dizer: “Publique, por favor.” Nem sei como dizer “por favor”. Pelo menos estou tentando dizer “por favor”. Agora vamos permitir que ele publique e podemos ver que ficou verdinho. Está publicado. Isso significa que, se eu entrar e, sabe, ele começar a dizer coisas, não vou ler. Se eu der uma estrela no meu próprio repo, devemos receber uma nova estrela para

03:07 mim tão rápido quanto isso. Então, talvez, quando eu receber minha terceira estrela, fique sabendo imediatamente. Espero que isso ajude e mostre como é fácil configurar algo super simples no n8n. Todos os recursos estão na descrição, em alguns links. É só descer, clicar e você vai encontrar o que precisa. Se algo não estiver funcionando para você, deixe um comentário e farei o possível para responder. Até o próximo vídeo.

Transcrição original

[00:00] I just released this GitHub project the other day, and I am honestly tired of staring at it, just waiting to get stars. So I decided to set up a Slack notification for when a star comes in. So that’s what we’re doing in this video. I’m making this in the n8n Assistant, which is n8n’s built-in, you know, agent builder. So you can get to it from this button here. I’m going to build it in my super cool project. Um, project? Because I think it qualifies. And in here, you just say what you want. So you can just put in like, I want a Slack notification when someone stars my

[00:31] GitHub repo, and I’ll paste in my Slack ID. And the repo is liammcgarigal slash indieartifacts. I want the message to be a simple like new star from username with a star emoji. And we can send this off and it should just start building. This is a fresh project, so there’s no connection set up. So it will probably make a very simple workflow since this is a pretty simple use case. and ask me to enter in a GitHub connection and a Slack connection. We can see here all the things that it’s working on.

[01:01] We can expand this too and see like the skills and all the stuff that it’s doing under the hood. But you know, we can make it ourselves if we want to do all that thinking. We’ll just close this. It took 36 seconds and we already have our simple workflow here. It’s only three nodes when it’s a new star. It is asking us to set up our GitHub. Since I’m on N8nCloud, which is our hosted solution, It’s just a one click connection to do this. If you’re on the free self-hosted edition, you’ll have access to all of this. Like you just have to bring your own API key for the AI and you’ll have to set it up manually, which means you have to go to GitHub, get an API key,

[01:34] but I can just click and it’ll connect just like that. And now we have Slack, which we could do the same click to connect, but that would be to give it access to our own user account. So it will send messages as liam mcgarigal me which isn’t great because then i’ll get a dm for myself and i won’t get a notification for it i want it to come from a bot account so we’re going to set it up manually and we’ll come to access token and i already copied my access token before so that i wouldn’t have to show it on video to everybody but i’ll paste it in there and this is just a bot i set up on Slack

[02:05] before it’s not that hard uh you just have to go through and follow the instructions You can check out the docs right here if you’re having trouble there. But I’ll save this and say apply. And then it should go through and add it in there. And it looks like it still has the little things here. I’ve noticed before if you just open it and close it, then it kind of refreshes it. Still an unpublished draft. So now I’m going to say let’s try it for real and see if I actually get a DM. Okay, it asks. So I’ll say always allow.

[02:37] Nice. Now let’s check our Slack and we got a new star. So we’ll do a little bit of, you know, something like that. And now it works. So we can obviously just press publish right here, but I don’t know how to do anything myself anymore. So I’ll say publish it, please. I don’t even know how to say please. At least I’m trying to say please. So now we’ll allow it to publish and we can see there nice and green. So it’s published, which means if I go in and, you know, it’s going to say stuff, but I’m not going to read it. if I star my own repo, we should have a new star for

[03:07] me just as fast as that. So now maybe when I get my third star, I’ll know about it immediately. I hope this helps and shows how you can set something up that’s super simple in N8M just really easily. All the resources are in the description in some links. So you just go down there, click away and you’ll find what you need. If something’s not working for you, leave a comment and I’ll do my best to answer you. See you in the next one.