プルリクエストが発生すると電報で通知される
2500 ワード
電報は、開発者フレンドリーな機能の多くのクールメッセージングプラットフォームです.私は、私のgithub公共のリポジトリにプル要求が上がるたびに、私が通知を受けることができるかどうか疑問に思いました.
Gitハブアクションの活用
、新しいワークフロー を作成してください選択した単純なワークフローを選択します.
は新しいボットを作成するためにTelegram Bot Fatherを使用します. ボットが作成されるとトークンを返し、保存します. は、電報グループを作成し、グループにこのボットを追加します. このグループにテストメッセージを追加します. グループのユニークなIDを得るために、. は、
リポジトリ の下の設定に移動します
は、上からトークン値で グループのユニークなIDで おっと!プルリクエストが発生すると、グループに通知が送信されます.
Gitハブアクションの活用
GitHub Actionsは、あなたのgithubリポジトリのすべての種類のオートメーションをするのに用いられることができます.
迅速にいくつかのGoogle検索を行うと、私はプルリクエストが発生したときに電報の通知を送信するために使用できるアクションを見つけた.
新しいワークフローを作成する
あなたの倉庫ホームページの下で
# This is a basic workflow to help you get started with Actions
name: Telegram notification
# Controls when the action will run. Triggers the workflow on pull request
on:
pull_request:
branches: [ develop ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs the telegram notify action to send a notification
- name: Telegram Notify
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: markdown
message: |
A new PR is raised [View all PR's](https://github.com/<user>/<repo>/pulls)
電報ボットトークンとグループユニークIDを取得
https://api.telegram.org/bot<token>/getUpdates
chat.id
の下でグループユニークなIDを見つけますワークフローに必要な秘密を作成する
secrets
の下のTELEGRAM_TOKEN
と呼ばれている新しい秘密を作成します.TELEGRAM_TO
と呼ばれる新しい秘密を作成します.アップル / 電報行為
電報を送るgithubアクション。
Reference
この問題について(プルリクエストが発生すると電報で通知される), 我々は、より多くの情報をここで見つけました https://dev.to/nikhilvemula/get-notified-via-telegram-when-pull-request-is-raised-4ha4テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol