Skip to content

Lukasss93/telegram-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

✈ Notify via Telegram

GitHub Action for sending a Telegram notification message.

This action send a message via Telegram when there is a push/release.

👓 Usage

Send a default message on push/release event:

name: Notify
on:
  push:
  release:
    types: [published]

jobs:
  notify:
    name: Notify via Telegram
    runs-on: ubuntu-latest
    steps:
      - name: Send message to Telegram
        uses: Lukasss93/telegram-action@v2
        env:
          TELEGRAM_TOKEN: ${{ secrets.telegram_token }}
          TELEGRAM_CHAT: ${{ secrets.telegram_chat }}

💼 Environment variables

  • TELEGRAM_TOKEN string - Telegram authorization token
  • TELEGRAM_CHAT string - Unique identifier chat

How to get a telegram token: BotFather

How to get a telegram chat identifier:

  1. Forward a message from the target chat to @JsonDumpBot
  2. Copy the messageforward_from_chatid

📝 Inputs variables

Input Optional? Expected value Description
commit_template Yes File path Override the default commit template message
release_template Yes File path Override the default commit template message
status Yes ${{job.status}} Job status

🎭 Default Templates

// ./templates/commit.mustache

{{#commits}}
<a href="{{{repo_url}}}">{{repo_name}}</a> • <a href="https://github.com/{{actor}}">{{actor}}</a> • <a href="{{commit_url}}">{{commit_sha}}</a>
{{commit_message}}

{{/commits}}

{{status}}
// ./templates/release.mustache

<a href="{{{tag_url}}}">New {{repo_name}} release</a>: <code>{{tag_name}}</code> ({{tag_type}})
{{{body}}}

✨ Workflow examples

Check this workflow: test.yml

📃 Changelog

Please see the CHANGELOG.md for more information on what has changed recently.

📖 License

Please see the LICENSE.md file for more information.