Telegram Notification for Github action
Guide to create a bot and adding to telegram chat
add TELEGRAM_BOT_ID and TELEGRAM_CHAT_ID to the secrets in github repo
Example
name: Telegram Notification
on:
push:
branches: [master]
jobs:
Publish:
runs-on: [ubuntu-latest]
steps:
- name: checkout master branch # checkout master branch
uses: actions/checkout@v2
with:
persist-credentials: false
- name: run yarn install and build # go to temp folder and run npm build to create files.
run: |
cd temp
yarn install
yarn build
- name: Notify via TELEGRAM BOT
uses: RizkyRajitha/github_actions_notify_telegram@v1
with:
TELEGRAM_BOT_ID: ${{ secrets.TELEGRAM_BOT_ID }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
CUSTOMMESSAGESUCCESS: "Published \xF0\x9F\x9A\x80 Blog via GitHub Actions"
CUSTOMMESSAGESFAILURE: "Publishing Blog \xE2\x9B\x94 via GitHub Actions Failed"
CUSTOMMESSAGESCANCELLED: "Publishing Blog \xE2\x9B\x94 via GitHub Actions Cancelled"
JOBSTATUS: ${{ job.status }}
GITHUB_RUN_NUMBER: ${{ github.run_number }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
GITHUB_SHA: ${{ github.sha }}