From 5b3a0808ef4177243ad56e8c62444c2fdb60a39b Mon Sep 17 00:00:00 2001 From: nyne <67669799+wgh136@users.noreply.github.com> Date: Thu, 7 Nov 2024 18:38:25 +0800 Subject: [PATCH] Create tg.yaml --- .github/workflows/tg.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/tg.yaml diff --git a/.github/workflows/tg.yaml b/.github/workflows/tg.yaml new file mode 100644 index 0000000..29e2d65 --- /dev/null +++ b/.github/workflows/tg.yaml @@ -0,0 +1,27 @@ +name: Telegram Notification + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + notify: + runs-on: ubuntu-latest + steps: + - name: Send Telegram notification + uses: appleboy/telegram-action@master + with: + to: ${{ secrets.TELEGRAM_TO }} + token: ${{ secrets.TELEGRAM_TOKEN }} + message: | + ${{ github.event_name == 'issues' && '新 Issue 已创建' || '新 Pull Request 已提交' }} + + ${{ github.event.issue.title || github.event.pull_request.title }} + + 作者: ${{ github.event.issue.user.login || github.event.pull_request.user.login }} + + 链接: ${{ github.event.issue.html_url || github.event.pull_request.html_url }} + + 仓库: ${{ github.repository }}