From 81000462d9aeb83d03880fdbd6fc8e76881dd0f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Mar=C3=ADn?= Date: Thu, 9 Apr 2020 00:07:42 +0200 Subject: [PATCH 1/7] Add github actions for sending telegram notifications on pull_requests --- .github/workflows/notify-telegram.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/notify-telegram.yml diff --git a/.github/workflows/notify-telegram.yml b/.github/workflows/notify-telegram.yml new file mode 100644 index 0000000..46b5377 --- /dev/null +++ b/.github/workflows/notify-telegram.yml @@ -0,0 +1,15 @@ +--- +name: Send notification to Telegram group +on: [pull_request] + +jobs: + build: + name: Notify telegram + runs-on: ubuntu-latest + steps: + - uses: yanzay/notify-telegram@v0.1.0 + if: always() + with: + chat: ${{ secrets.chat }} + token: ${{ secrets.token }} + status: ${{ job.status }} \ No newline at end of file From 7c4b781ba349f32fd861af7c793f5a81eb0cd937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Mar=C3=ADn?= Date: Thu, 9 Apr 2020 00:14:07 +0200 Subject: [PATCH 2/7] Remove yml header for github actions --- .github/workflows/notify-telegram.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/notify-telegram.yml b/.github/workflows/notify-telegram.yml index 46b5377..e47c53b 100644 --- a/.github/workflows/notify-telegram.yml +++ b/.github/workflows/notify-telegram.yml @@ -1,6 +1,5 @@ ---- name: Send notification to Telegram group -on: [pull_request] +on: [push, pull_request] jobs: build: From a173b3d0bc564105c8709dcf4c8146e324251a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Mar=C3=ADn?= Date: Thu, 9 Apr 2020 00:15:12 +0200 Subject: [PATCH 3/7] Fix identation in github actions --- .github/workflows/notify-telegram.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/notify-telegram.yml b/.github/workflows/notify-telegram.yml index e47c53b..aaddc73 100644 --- a/.github/workflows/notify-telegram.yml +++ b/.github/workflows/notify-telegram.yml @@ -7,8 +7,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: yanzay/notify-telegram@v0.1.0 - if: always() - with: - chat: ${{ secrets.chat }} - token: ${{ secrets.token }} - status: ${{ job.status }} \ No newline at end of file + if: always() + with: + chat: ${{ secrets.chat }} + token: ${{ secrets.token }} + status: ${{ job.status }} \ No newline at end of file From d9eae6413357a361cef4ed2b039ac247e5e7eea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Mar=C3=ADn?= Date: Thu, 9 Apr 2020 00:28:01 +0200 Subject: [PATCH 4/7] Use a different Github action for sending notifications The new Github action allows custom messages, for doing the bot more friendly. --- .github/workflows/notify-telegram.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/notify-telegram.yml b/.github/workflows/notify-telegram.yml index aaddc73..bd58172 100644 --- a/.github/workflows/notify-telegram.yml +++ b/.github/workflows/notify-telegram.yml @@ -1,14 +1,15 @@ name: Send notification to Telegram group -on: [push, pull_request] +on: [pull_request] jobs: build: - name: Notify telegram + name: Send notification runs-on: ubuntu-latest steps: - - uses: yanzay/notify-telegram@v0.1.0 - if: always() - with: - chat: ${{ secrets.chat }} - token: ${{ secrets.token }} - status: ${{ job.status }} \ No newline at end of file + - name: send custom message + uses: appleboy/telegram-action@master + with: + to: ${{ secrets.TELEGRAM_TO }} + token: ${{ secrets.TELEGRAM_TOKEN }} + message: | + El usuario ${{ github.actor }} ha enviado un nuevo pull request al repositorio ${{ repo }}. ¡Gracias! \ No newline at end of file From aa62afae2509cbfcf826a9d0105f4758e4d2b639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Mar=C3=ADn?= Date: Thu, 9 Apr 2020 00:35:13 +0200 Subject: [PATCH 5/7] Fix bad variable value --- .github/workflows/notify-telegram.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/notify-telegram.yml b/.github/workflows/notify-telegram.yml index bd58172..c5d9d2f 100644 --- a/.github/workflows/notify-telegram.yml +++ b/.github/workflows/notify-telegram.yml @@ -12,4 +12,4 @@ jobs: to: ${{ secrets.TELEGRAM_TO }} token: ${{ secrets.TELEGRAM_TOKEN }} message: | - El usuario ${{ github.actor }} ha enviado un nuevo pull request al repositorio ${{ repo }}. ¡Gracias! \ No newline at end of file + El usuario ${{ github.actor }} ha enviado un nuevo pull request al repositorio ${{ github.repo }}. ¡Gracias! \ No newline at end of file From 2a8f56b02dea49f1822c2cb8b93a593d16f81c0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Mar=C3=ADn?= Date: Thu, 9 Apr 2020 01:07:31 +0200 Subject: [PATCH 6/7] Also send notification in push --- .github/workflows/notify-telegram.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/notify-telegram.yml b/.github/workflows/notify-telegram.yml index c5d9d2f..b66fcd4 100644 --- a/.github/workflows/notify-telegram.yml +++ b/.github/workflows/notify-telegram.yml @@ -1,5 +1,5 @@ name: Send notification to Telegram group -on: [pull_request] +on: [push, pull_request] jobs: build: @@ -12,4 +12,4 @@ jobs: to: ${{ secrets.TELEGRAM_TO }} token: ${{ secrets.TELEGRAM_TOKEN }} message: | - El usuario ${{ github.actor }} ha enviado un nuevo pull request al repositorio ${{ github.repo }}. ¡Gracias! \ No newline at end of file + El usuario ${{ github.actor }} ha enviado cambios al repositorio ${{ github.repo }}. ¡Gracias! \ No newline at end of file From 4f9ede853c587906615fa6b58fb751491eb2ff86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Mar=C3=ADn?= Date: Thu, 9 Apr 2020 01:21:53 +0200 Subject: [PATCH 7/7] Improve notification message --- .github/workflows/notify-telegram.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/notify-telegram.yml b/.github/workflows/notify-telegram.yml index b66fcd4..f860965 100644 --- a/.github/workflows/notify-telegram.yml +++ b/.github/workflows/notify-telegram.yml @@ -12,4 +12,4 @@ jobs: to: ${{ secrets.TELEGRAM_TO }} token: ${{ secrets.TELEGRAM_TOKEN }} message: | - El usuario ${{ github.actor }} ha enviado cambios al repositorio ${{ github.repo }}. ¡Gracias! \ No newline at end of file + El usuario ${{ github.actor }} ha aplicado cambios al repositorio de documentación. Más información en https://github.com/aredn/documentation_es \ No newline at end of file