ozanerturk / telegram-action

Notify via Telegram!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

✈ 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@v1
        env:
          TELEGRAM_TOKEN: ${{ secrets.telegram_token }}
          TELEGRAM_CHAT: ${{ secrets.telegram_chat }}
        with: 
          STATUS: ${{job.status}} # this is required for accessing the status of certain job

You can pass the following optional inputs:

        with: 
          footer: 'Append a message to default message'
          message: 'Override the default message (footer included)'

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

  • footer optional string - Append a message to default message
  • message optional string - Override the default message (footer included)

Default Messages

For Push
author/repo¹ • hash²
Commit message

¹ with repo link

² with hash link

It supports multiple commits in a unique message.

For Release
New author/repo release¹: tag² (type³)

Tag message

¹ with tag link

² tag name

³ beta if it's a pre-release otherwise stable

About

Notify via Telegram!


Languages

Language:JavaScript 100.0%