Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Git Hub
Git Hub
Guía de GitHub by dM
====================
=============================================
Crear archivo README para el perfil de Github
=============================================
Fuente
======
ChatGPT
==============
GitHub Actions
==============
Además, también puedes usar las acciones predefinidas de GitHub que están
disponibles en su Marketplace. Estas acciones predefinidas pueden ayudarte a
realizar tareas comunes, como construir y probar tu aplicación, desplegar tu
aplicación en diferentes plataformas, enviar notificaciones a través de
diferentes canales, entre otros.
Las GitHub Actions son muy flexibles y personalizables, lo que las hace útiles
para una amplia variedad de casos de uso en el desarrollo de software.
======================================================================
=
Recibir notificaciones en telegram de las acciones de un repo de GitHub
======================================================================
=
1- Primero debes crear un nuevo bot. Abre Telegram y busca el bot "BotFather".
Ejemplo:
/newbot
BotFather:
Alright, a new bot. How are we going to call it? Please choose a name for your bot.
prueba
BotFather:
Good. Now let's choose a username for your bot. It must end in `bot`. Like this,
for example: TetrisBot or tetris_bot.
pruebabot
BotFather:
Done! Congratulations on your new bot. You will find it at t.me/pruebabot. You
can now add a description, about section and profile picture for your bot, see
/help for a list of commands. By the way, when you've finished creating your
cool bot, ping our Bot Support if you want a better username for it. Just make
sure the bot is fully operational before you do this.
-----
¡Listo! Ahora tienes un bot de Telegram. Puedes usar el token de acceso para
enviar solicitudes a la API de Telegram y crear las funcionalidades que deseas
para tu bot. Por ejemplo, puedes configurar el bot para enviar mensajes
automáticos, responder a comandos o interactuar con otros usuarios de Telegram.
5- Ahora vamos al repo que queremos que notifique cuando tenga interacciones Y
creamos en la raíz un directorio .github y dentro otro con nombre workflows y
luego dentro un archivo con nombre main.yml es decir este nuevo archivo estará
en la ruta .github/workflows/main.yml, el contenido de ese archivo será:
-----
on:
issues:
types: [opened, reopened, deleted, closed]
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send notifications to Telegram
run: curl -s -X POST https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN
}}/sendMessage -d chat_id=${{ secrets.TELEGRAM_CHAT_ID }} -d text="${MESSAGE}" >>
/dev/null
env:
MESSAGE: "Issue ${{ github.event.action }}: \n${{ github.event.issue.html_url }}"
-----
on:
issues:
types: [opened, reopened, deleted, closed]
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send notifications to Telegram
run: curl -s -X POST https://api.telegram.org/botxxxxx/sendMessage -d chat_id=xxxxx -d
text="${MESSAGE}" >> /dev/null
env:
MESSAGE: "Issue ${{ github.event.action }}: \n${{ github.event.issue.html_url }}"
-----
6- Pruébalo!!!
Ahora vamos a mostrar una configuración que notifique cuando hay un push al
repositorio:
on: [push]
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send notifications to Telegram
run: curl -s -X POST https://api.telegram.org/botXXXXXXXXX/sendMessage -d
chat_id=XXXX -d text="${MESSAGE}" >> /dev/null
env:
MESSAGE: "Se ha realizado un nuevo push en la rama ${{ github.ref }}, el mensaje del
commit es: ${{ github.event.head_commit.message }} y el enlace al commit es ${{
github.event.head_commit.url }}."
-----
Fuente
=======
https://odoo-devops.readthedocs.io/en/latest/git/github-telegram-notifications.html
ChatGPT