Send simple message via channel's RESTful API.
Support channels:
- Telegram
- Line Notify
- Hangouts Chat
- Slack
- Discord
Pre-build container image on Releases
Repository: ghcr.io/timfanda35/simple-channel-notify
Send notify message to Telegram
docker run \
-e NOTIFY_TELEGRAM_TOKEN="$NOTIFY_TELEGRAM_TOKEN" \
-e NOTIFY_TELEGRAM_CHAT_ID="$NOTIFY_TELEGRAM_CHAT_ID" \
ghcr.io/timfanda35/simple-channel-notify \
telegram --message="Notify Message~~~"
Environment Variables
NOTIFY_TELEGRAM_TOKEN
NOTIFY_TELEGRAM_CHAT_ID
References:
Send notify message to Line Notify
docker run \
-e NOTIFY_LINE_NOTIFY_TOKEN="$NOTIFY_LINE_NOTIFY_TOKEN" \
ghcr.io/timfanda35/simple-channel-notify \
linenotify --message="Notify Message~~~"
Environment Variables
NOTIFY_LINE_NOTIFY_TOKEN
References:
Send notify message to Hangouts Chat
docker run \
-e NOTIFY_HANGOUTS_CHAT_WEBHOOK="$NOTIFY_HANGOUTS_CHAT_WEBHOOK" \
ghcr.io/timfanda35/simple-channel-notify \
hangoutschat --message="Notify Message~~~"
Environment Variables
- NOTIFY_HANGOUTS_CHAT_WEBHOOK
References:
Send notify message to Slack Channel
docker run \
-e NOTIFY_SLACK_WEBHOOK="$NOTIFY_SLACK_WEBHOOK" \
ghcr.io/timfanda35/simple-channel-notify \
slack --message="Notify Message~~~"
Environment Variables
NOTIFY_SLACK_WEBHOOK
References:
Send notify message to Discord Text Channel
docker run \
-e NOTIFY_DISCORD_WEBHOOK="$NOTIFY_DISCORD_WEBHOOK" \
ghcr.io/timfanda35/simple-channel-notify \
discord --message="Notify Message~~~"
Environment Variables
NOTIFY_DISCORD_WEBHOOK
References:
Set the required environment variables in GitLab Settings -> Secrets -> Acctions
page.
NOTIFY_TELEGRAM_TOKEN
NOTIFY_TELEGRAM_CHAT_ID
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Notify
run: |
docker run \
-e NOTIFY_TELEGRAM_TOKEN="${{ secrets.NOTIFY_TELEGRAM_TOKEN }}" \
-e NOTIFY_TELEGRAM_CHAT_ID="${{ secrets.NOTIFY_TELEGRAM_CHAT_ID }}" \
ghcr.io/timfanda35/simple-channel-notify \
telegram --message="Notify Message~~~"
Reference: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
Set the required environment variables in GitLab Settings -> CI/CD -> Variables
page.
NOTIFY_TELEGRAM_TOKEN
NOTIFY_TELEGRAM_CHAT_ID
.gitlab-ci.yml
stages:
- run
notify-telegram:
stage: run
image:
name: 'ghcr.io/timfanda35/simple-channel-notify'
entrypoint: [""]
script:
- /app telegram --message="Message from GitLab CI"
Reference: https://docs.gitlab.com/ee/ci/yaml/gitlab_ci_yaml.html
cloudbuild.yaml
steps:
- name: 'ghcr.io/timfanda35/simple-channel-notify'
args: [ 'telegram', '--message=Message from Cloud Build' ]
env:
- 'NOTIFY_TELEGRAM_TOKEN=${_NOTIFY_TELEGRAM_TOKEN}'
- 'NOTIFY_TELEGRAM_CHAT_ID=${_NOTIFY_TELEGRAM_CHAT_ID}'
Build container image
docker build -t simple-channel-notify .