Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
play

GitHub Action

External Telegram Notifications

v0.1.0

External Telegram Notifications

play

External Telegram Notifications

Configure an endpoint to get the content to send to a telegram chat

Installation

Copy and paste the following snippet into your .yml file.

              

- name: External Telegram Notifications

uses: danilat/externalized-telegram-notifications-action@v0.1.0

Learn more about this action in danilat/externalized-telegram-notifications-action

Choose a version

Externalized Telegram Notifications-action action

GitHub Action that send messages to Telegram, previously retrieves the message content from an external url. Html (default mode) or markdown formats are both supporte in the retrieved content for the message.

The purpose of this action is get a changelog with the changes from an external url and send it to a telegram channel.

You should add cofigurations for: to with a channel id or a chat id , token with your telegram token, content-url with a public accesible url that has the content that you cant to send. Optionally you can send the parse_mode that it'll be used for telegram API.

Example usage

name: Send notifications to telegram
on:
  push
jobs:
  build:
    name: A job to launch telegram notifications
    runs-on: ubuntu-latest
    steps:
    - name: Send notifications
      id: send_notificsations
      uses: danilat/externalized-telegram-notifications-action@master
      with:
        to: ${{ secrets.TELEGRAM_ID_OR_CHANNEL }}
        token: ${{ secrets.TELEGRAM_TOKEN }}
        content-url: ${{ secrets.CONTENT_URL }}
        parse_mode: html

Considerations

  • You'll get the telegram token when you create your bot using the BotFather.
  • If you want send messages for a channel you should use @channelname in to variable.
  • If you want send messages to a user you need the id of the conversation using, you can get it with curl https://api.telegram.org/bot<telegram_token>/getUpdates.
  • In the content that responds to content-url you should use only the supported formatting options.