telegram - Github Actions:缺少电报令牌或用户列表
问题描述
每次有人推送给 repo 的主人时,我都在尝试使用 Github Actions 发送 Telegram 消息。但是使用此操作会导致以下错误并且操作失败:
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 的新手。我应该怎么做才能解决这个问题?
PS:我已将 telegram_token 和 telegram_chat_id 添加到 repo 的 secrets 部分。
解决方案
转到 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
推荐阅读
- ios - Xcode UITesting LoginUser 重定向到 homeScreen
- javascript - Jquery Collapse 面板无法正常工作
- python - Python 为自定义类定义 []、len()、items() 和 keys() 运算符
- typescript - tsconfig.json 中的 --inlineSourceMap 或 --sourceMap
- javascript - 为什么正则表达式在 ie 中不起作用?
- java - 有没有办法将 java 方法声明为 kotlin 的中缀
- angularjs - PhpStorm:IDE 未正确评估 AngularJS ng-repeat microSyntax
- deep-learning - 如何在pycharm中禁用运行纪元的详细视图并使其显示有关运行纪元的更少细节?
- image - AutoHotKey 确定图像搜索位置
- python - Django 按类别 ID 显示子类别