WechatOnCloud/.github/workflows/telegram-bot.yml
Kris e35f1d64cf feat: 初始化项目,添加完整的微信云部署方案与面板实现
包含以下核心内容:
1.  完整的Docker容器化部署方案,支持多架构amd64/arm64
2.  自研Web管理面板,包含登录认证、实例管理、权限控制
3.  微信实例容器镜像,内置中文字体与输入法修复
4.  飞牛OS应用打包适配
5.  完整的文档与运维指南
2026-07-05 03:50:30 +08:00

41 lines
1.5 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: telegram-bot
# Telegram 命令机器人(轮询版)——无需服务器,仅靠 GitHub Actions cron。
# 私聊 / 群组都可用命令查询:/help /releases /release <tag> /issues /issue <编号>。
#
# 启用(一次性):
# 1) 已配置 telegram-notify 用到的 TELEGRAM_BOT_TOKENSecret即可复用
# 2) 仓库 Settings → Secrets and variables → Actions → Variables 新建
# TELEGRAM_BOT_ENABLED = true (未设为 true 则本工作流不运行,避免空跑)
# 3) 把机器人拉进群组 / 在私聊里 /start。
#
# 局限cron 最小 5 分钟且可能再延后 → 命令非实时GitHub 会在仓库 60 天无活动时暂停定时任务。
# 想立即处理一次Actions → telegram-bot → Run workflowworkflow_dispatch
on:
schedule:
- cron: '*/5 * * * *'
workflow_dispatch: {}
permissions:
contents: read
issues: read
# 避免轮询任务并发重叠重复处理;新触发取消正在跑的(残留未确认更新下次重处理,无副作用)
concurrency:
group: telegram-bot
cancel-in-progress: true
jobs:
poll:
runs-on: ubuntu-latest
if: ${{ vars.TELEGRAM_BOT_ENABLED == 'true' }}
steps:
- uses: actions/checkout@v4
- name: Poll Telegram & handle commands
env:
TG_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
run: node .github/scripts/telegram-bot.mjs