【问题标题】:Github Actions: missing telegram token or user listGithub Actions:缺少电报令牌或用户列表
【发布时间】:2020-09-09 10:59:22
【问题描述】:

每次有人推送到 repo 的主人时,我都在尝试使用 Github Actions 发送 Telegram 消息。但是使用this action 会导致以下错误并且操作失败:

missing telegram token or user list

这是我的 yml 文件:

name: CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Telegram Notify
        uses: appleboy/telegram-action@0.0.3
        with:
          to: ${{ secrets.TELEGRAM_CHAT_ID }}
          token: ${{ secrets.TELEGRAM_TOKEN }}
          message: |
            An event occured in ${{ github.repository    }} repository.
            ${{ github.event_name }}

我是 Github Actions 的新手。我应该怎么做才能解决这个问题?

P.S:我已将 telegram_token 和 telegram_chat_id 添加到 repo 的 secrets 部分。

【问题讨论】:

    标签: telegram github-actions


    【解决方案1】:

    转到 repo 设置并设置 TELEGRAM_CHAT_ID 和 TELEGRAM_TOKEN 的机密。设置 TELEGRAM_TOKEN 的机密时,请确保使用机器人令牌 https://api.telegram.org/bot/METHOD_NAME 将查询发送到 Telegram Bot API,例如 https://api.telegram.org/bot19023205:BNF-23dred1234ghIkl-dre4fdgr8nv1w4od/getMe

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-19
      • 2013-12-02
      • 2017-04-12
      • 1970-01-01
      • 1970-01-01
      • 2022-08-08
      相关资源
      最近更新 更多