Watch
1
0
Fork
You've already forked telegram-notifier
0
mirror of https://github.com/ardocrat/actions-telegram-notifier synced 2026-11-10 18:57:40 +00:00
No description
  • Rust 98.2%
  • Dockerfile 1.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
prodream cd0c30744b
Some checks failed
Build And Push Telegram Notify Action / Build Docker image for linux/amd64 (push) Has been cancelled
Build And Push Telegram Notify Action / Build Docker image for linux/arm64 (push) Has been cancelled
Build And Push Telegram Notify Action / Merge Docker manifests (push) Has been cancelled
Build And Push Telegram Notify Action / notify (push) Has been cancelled
Fix api_url default value if not provided
2026-01-24 23:24:18 +04:00
.github/workflows ci: arm platform support with matrix build 2026-01-22 14:07:30 +03:00
img docs: bump version to 2.1 and update README.md 2025-03-22 14:25:58 +04:00
src Fix api_url default value if not provided 2026-01-24 23:24:18 +04:00
.gitignore Firs version 2024-12-15 18:42:17 +04:00
action.yml feat: custom bot api url 2026-01-23 17:00:25 +03:00
Cargo.lock bump version to 2.2 2026-01-24 23:07:27 +04:00
Cargo.toml bump version to 2.2 2026-01-24 23:07:27 +04:00
CHANGELOG.md Fix api_url default value if not provided 2026-01-24 23:24:18 +04:00
Dockerfile bump version to 2.2 2026-01-24 23:07:27 +04:00
LICENSE Initial commit 2024-12-15 18:03:01 +04:00
README-RU.MD Fix api_url default value if not provided 2026-01-24 23:24:18 +04:00
README.MD Fix api_url default value if not provided 2026-01-24 23:24:18 +04:00

Napkin Tools: Actions Telegram Notify

GitHub License GitHub Actions Workflow Status Код на салфетке Заметки на салфетке

An action for sending notifications to Telegram about the status of a Workflow execution in a GitHub/Gitea/GitHub Actions-compatible CI/CD system.

Actions Telegram Notify helps track the status of running Workflows.

Русская версия

Table of Contents

Features

  • Sends status updates to Telegram (e.g., success, failure, canceled).
  • Customizable notifications with a title, message, and footer.
  • Includes additional fields such as commit author, repository, workflow name, and more.
  • Supports Push, Pull Request and Workflow Dispatch events. (Need more? Open an Issue or submit a Pull Request!)
  • Automatically generates a button with a link to the Commit or Pull Request in the notification.

Requirements

To use Actions Telegram Notify, you need:

  • Telegram Bot Token (can be created via BotFather).
  • Telegram Chat ID:
    • For direct messages from the bot: 1234567.
    • For a small group: -1234567.
    • For a large group/supergroup: -1001234567.
    • Important:
      • For direct messages, you need to start a chat with the bot.
      • For groups, add the bot and grant it minimal admin rights to send messages.
  • (Optional) Telegram Chat Thread ID – required for sending messages to a specific topic in a supergroup.

Execution Arguments

Name Required Description
token Yes Telegram Bot Token. Use GitHub Secrets for secure storage.
chat_id Yes Telegram Chat ID. Use GitHub Secrets for secure storage.
api_url No Custom Telegram Bot API URL. Use GitHub Secrets for secure storage.
thread_id No Telegram Chat Thread ID.
status No Workflow status, retrieved from ${{ job.status }} or set manually (e.g., pending). Defaults to info if not specified.
title No Custom title text for the notification. Defaults to a general message.
message No Custom message text to include in the notification.
footer No Text to append at the end of the notification.
notify_fields No Comma-separated list of additional fields to include. See notify_fields Values for details.

status Values

Statuses apply to the Push event.

Value Description
success Workflow completed successfully.
failure Workflow failed.
cancelled Workflow was canceled.
pending Workflow is in progress.
info Informational status.

notify_fields Values

Field Event Description
actor Push, Pull Request, Workflow Dispatch Username with a profile link who triggered the Workflow.
repository Push, Pull Request, Workflow Dispatch Repository name with a link where the Workflow is running.
workflow Push, Pull Request, Workflow Dispatch Name of the running Workflow.
branch Push Branch where the Workflow was triggered.
commit Push First line of the commit message.
repo_with_tag Push Repository name with a tag.

Usage Example

Push Event

name: CI

on:
  push:

jobs:
  notify:
    runs-on: ubuntu-latest

    steps:
      - name: Run Actions Telegram Notify
        uses: proDreams/actions-telegram-notifier@main
        if: always()
        with:
          token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
          chat_id: ${{ secrets.TELEGRAM_CHAT_ID }}
          status: ${{ job.status }}
          notify_fields: "actor,repository,workflow,branch,commit"
          message: "Test message."
          footer: "Test footer"

Field Breakdown

  • name - Specifies the step name (optional).
  • uses - Specifies the Action to use. It is recommended to use the latest version from the main branch.
  • if - Defines the execution condition:
    • always() - Always runs, regardless of Workflow status (recommended).
    • cancelled() - Runs only if the Workflow was canceled.
    • failure() - Runs only if the Workflow failed.
    • success() - Runs only if the Workflow was successful.
  • with - List of input parameters required for execution. See Execution Arguments for details.

Pull Request Event

name: CI

on:
  pull_request:
    types:
      - closed
      - opened

jobs:
  notify:
    runs-on: ubuntu-latest

    steps:
      - name: Run Actions Telegram Notify
        uses: proDreams/actions-telegram-notifier@main
        if: always()
        with:
          token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
          chat_id: ${{ secrets.TELEGRAM_CHAT_ID }}
          status: ${{ job.status }}
          notify_fields: "actor,repository,workflow"

Workflow Dispatch Event

name: CI

on:
  workflow_dispatch:
    inputs:
      custom_input:
        description: 'Custom Input'
        required: false

jobs:
  notify:
    runs-on: ubuntu-latest

    steps:
      - name: Run Actions Telegram Notify
        uses: proDreams/actions-telegram-notifier@main
        if: always()
        with:
          token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
          chat_id: ${{ secrets.TELEGRAM_CHAT_ID }}
          status: ${{ job.status }}
          notify_fields: "actor,repository,workflow"

Notification Examples

Notification for Successful Workflow Completion in a Push Event

Success

Notification for Opening a Pull Request

PR Opened

Notification for Closing a Pull Request

PR Closed

Notification for Merging a Pull Request

PR Merged

Notification for Workflow Dispatched

Workflow Dispatched

Author

This Action was created as part of the "Code on a Napkin" project:

Support

If you like this project and would like to support its further development, please consider making a donation:

Contributors

Contributors

License

This project is distributed under the MIT License. See the LICENSE file for details.