Files
Gloridust 54ed841a68 feat(admin/ci): 管理页折叠菜单 + 空状态/主页优化 + Telegram 命令机器人
管理页 UI/UX
- 实例卡片操作改为「管理」分类折叠菜单(默认收起,点开按 运维/设置/危险 分组的
  文字操作),替代之前难辨认的图标排;删除单独成组、红色,降低误点
- 修复展开一张卡片时同行其它卡片被 grid 拉等高(inst-grid align-items:start)
- 管理页空状态(无实例/无子账号)改为图标+标题+说明+引导按钮
- 主页实例卡片加副行(状态·微信版本)、悬停上浮高亮

Telegram 命令机器人(轮询版,纯 GitHub Actions,无服务器)
- .github/workflows/telegram-bot.yml + scripts/telegram-bot.mjs
- 私聊/群组命令:/help /releases /release <tag> /issues /issue <编号>
- cron 每 5 分钟 getUpdates,处理后用 offset 向 Telegram 确认,无需持久化存储
- 受 vars.TELEGRAM_BOT_ENABLED 开关;命令非实时(cron 限制),文档已说明

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 00:29:02 +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