Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
ff580b3
feat: 添加多渠道通知功能 + 代码精简优化
xfxx2022 Jul 11, 2026
4192abc
更新 README.md
xfxx2022 Jul 11, 2026
449ac0a
feat: 优化二维码显示+合并workflows
xfxx2022 Jul 11, 2026
a5c2d09
fix: 修复二维码显示+拆分登录workflow
xfxx2022 Jul 11, 2026
b8e6c45
fix: 修复Step Summary二维码图片不显示
xfxx2022 Jul 11, 2026
0190b70
fix: 修复二维码ASCII渲染崩溃 - this上下文丢失+参数顺序
xfxx2022 Jul 11, 2026
abec112
fix: 修复Summary空白 - 改为日志实时显示+workflow写入Summary
xfxx2022 Jul 11, 2026
db372f4
chore: keepalive at 2026-07-11
github-actions[bot] Jul 11, 2026
650adb7
修复Summary空白
xfxx2022 Jul 11, 2026
c6f4073
修复Summary空白
xfxx2022 Jul 11, 2026
9b24fbf
修复二维码扫描登录
xfxx2022 Jul 11, 2026
25dd4bd
fix: 二维码登录改用真实 PNG 图片展示(Summary <img>),替代不可扫的字符画
xfxx2022 Jul 11, 2026
0f0512a
feat: 生成自包含 HTML 登录页(大图二维码),解决日志无法显示图片的问题
xfxx2022 Jul 11, 2026
89f3b41
fix: 修复 gen 步骤不退出导致后续步骤不执行、二维码超时失效
xfxx2022 Jul 11, 2026
72e32be
fix: 改用 GitHub Release 直链展示二维码(免压缩包)+ 修复端口占用导致 wait 崩溃
xfxx2022 Jul 11, 2026
d36f31c
chore: 清理 Summary/日志冗余信息 + 登录后自动删除 Release
xfxx2022 Jul 11, 2026
346a738
fix: 全量审核修复10项问题 - 严重bug/进程退出/死代码/Summary
xfxx2022 Jul 11, 2026
ce2444c
perf: 全量优化10项 - send超时重试/通知防跳过/STARTTLS/Actions版本统一等
xfxx2022 Jul 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/KEEPALIVE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

This file is automatically updated to keep the repository active.

**Last Update:** 2026-07-01 02:49:14 UTC
**Workflow Run:** #3
**Trigger:** schedule
**Last Update:** 2026-07-11 06:29:05 UTC
**Workflow Run:** #1
**Trigger:** workflow_dispatch

---
*Auto-generated by [keepalive workflow](.github/workflows/keepalive.yml)*
*Auto-generated by [仓库保活 workflow](.github/workflows/仓库保活.yml)*
68 changes: 0 additions & 68 deletions .github/workflows/qrcodeLogin.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/sent.yml

This file was deleted.

175 changes: 175 additions & 0 deletions .github/workflows/二维码登录.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
name: 二维码登录
on:
workflow_dispatch:
inputs:
number:
description: "需要登录几个账号?"
required: true
default: "1"
append_user:
description: "是否追加新账号?(不删除已存在账号信息)"
required: true
type: choice
default: "否"
options:
- 是
- 否
print_userinfo:
description: "自动写入失败时是否在日志输出 USERINFO?(含登录token,默认否)"
required: true
type: choice
default: "否"
options:
- 否
- 是
# 需要 contents: write 才能创建 Release 上传二维码直链
permissions:
contents: write
jobs:
run:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: 检出仓库
uses: actions/checkout@v4

- name: 创建 Node 环境
uses: actions/setup-node@v4
with:
node-version: 24
cache: 'npm'
cache-dependency-path: ./api/package-lock.json

- name: 检查 GitHub CLI
run: |
if ! command -v gh >/dev/null 2>&1; then
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh -y
fi
gh --version

- name: 缓存依赖
id: cache-npm
uses: actions/cache@v4
with:
path: ./api/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('./api/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: 安装依赖
run: npm run install
if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}

# ════════════════════════════════════════════
# 步骤一:生成二维码 → PNG + Summary + HTML 登录页
# ✅ 完成后立即结束 step(process.exit(0) 保证干净退出)
# ════════════════════════════════════════════
- name: 生成二维码图片与HTML登录页
id: gen
run: node qrcodeLogin.js gen
env:
NUMBER: ${{ github.event.inputs.number }}

# ════════════════════════════════════════════
# 步骤二(核心):发布二维码为 GitHub Release 直链
# 浏览器点击链接即显示图片/网页,无需下载解压
# ════════════════════════════════════════════
- name: 发布二维码图片直链(👈 点击即可查看,无需下载解压)
id: publish
if: ${{ always() && steps.gen.outcome == 'success' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
TAG="qr-${{ github.run_id }}"
gh release create "$TAG" qr/*.png qr/login.html \
--repo "$GITHUB_REPOSITORY" \
--title "酷狗扫码登录二维码" \
--notes "用「酷狗音乐 APP」扫描下方二维码完成登录(约 2 分钟内有效)"

echo ""
echo "═══════════════════════════════════════════════════════"
echo " 📱 点击下方链接,浏览器直接显示二维码图片(无需解压):"
echo "═══════════════════════════════════════════════════════"
for f in qr/*.png; do
echo " 🔗 https://github.com/${{ github.repository }}/releases/download/$TAG/$(basename "$f")"
done
echo "═══════════════════════════════════════════════════════"

# 写入 Summary 页面,用户直接在 Summary 即可看到扫码链接
{
echo "## 🎵 酷狗音乐扫码登录"
echo ""
echo "请点击下方链接,浏览器打开即可扫码(约 2 分钟内有效):"
echo ""
for f in qr/*.png; do
echo "- 🔗 [账号 $(basename "$f" .png | sed 's/qr-//')] https://github.com/${{ github.repository }}/releases/download/$TAG/$(basename "$f")"
done
echo ""
echo "🌐 [HTML 登录页(含所有二维码)](https://github.com/${{ github.repository }}/releases/download/$TAG/login.html)"
echo ""
echo "⏳ 二维码有效期约 2 分钟,请尽快扫描"
} >> "$GITHUB_STEP_SUMMARY"

# ═══ 备用:HTML 仍上传为 artifact(万一 Release 失败兜底)═══
- name: 上传二维码 HTML 页面(兜底备份)
if: ${{ always() && steps.gen.outcome == 'success' && steps.publish.outcome != 'success' }}
uses: actions/upload-artifact@v4
with:
name: 二维码HTML
path: |
qr/login.html
qr/qr-*.html
retention-days: 1
if-no-files-found: warn

# ═══ 错误处理 ═══
- name: 二维码生成失败提示
if: ${{ failure() }}
run: |
echo "::error::❌ 二维码生成失败"
echo ""
echo "排查方向:"
echo " 1️⃣ 运行器网络是否能访问酷狗接口(查看上方步骤日志)"
echo " 2️⃣ npm 依赖安装是否成功"

# ════════════════════════════════════════════
# 步骤三:轮询等待用户扫码确认
# ════════════════════════════════════════════
- name: 等待扫码登录
if: ${{ always() && steps.gen.outcome == 'success' }}
run: node qrcodeLogin.js wait
env:
USERINFO: ${{ secrets.USERINFO }}
APPEND_USER: ${{ github.event.inputs.append_user }}
ALLOW_PRINT_USERINFO: ${{ github.event.inputs.print_userinfo }}
PAT: ${{ secrets.PAT }}
GITHUB_REPOSITORY: ${{ github.repository }}

# ═══ 清理:登录完成后立即删除本次 Release(不堆积)═══
- name: 清理本次二维码 Release
if: ${{ always() && steps.publish.outcome == 'success' }}
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
run: |
TAG="qr-${{ github.run_id }}"
gh release delete "$TAG" --repo "$GITHUB_REPOSITORY" -y 2>/dev/null \
&& echo "✅ 已删除本次 Release: $TAG" || echo "⚠️ Release $TAG 不存在或已删除"

# ═══ 兜底:清理残留的旧二维码 Release(保留最近 3 个)═══
- name: 清理旧的二维码 Release
if: ${{ always() }}
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release list --repo "$GITHUB_REPOSITORY" --limit 100 \
| awk '$1 ~ /^qr-/ {print $1}' | head -n -3 \
| while read t; do
gh release delete "$t" --repo "$GITHUB_REPOSITORY" -y 2>/dev/null
echo "已删除旧 Release: $t"
done || true
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Repository Keepalive
name: 仓库保活

on:
schedule:
# 每30天运行一次(可自定义),避免仓库未更新导致Actions被禁用
# 每30天运行一次,避免仓库未更新导致 Actions 被禁用
- cron: '0 0 */30 * *'
workflow_dispatch: # 允许手动触发
workflow_dispatch:

jobs:
keepalive:
Expand All @@ -13,14 +13,13 @@ jobs:
contents: write

steps:
- name: Checkout repository
- name: 检出仓库
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Update keepalive timestamp
- name: 更新保活时间戳
run: |
# 创建或更新保活文件
mkdir -p .github
cat > .github/KEEPALIVE.md << EOF
# Repository Keepalive
Expand All @@ -32,21 +31,20 @@ jobs:
**Trigger:** ${{ github.event_name }}

---
*Auto-generated by [keepalive workflow](.github/workflows/keepalive.yml)*
*Auto-generated by [仓库保活 workflow](.github/workflows/仓库保活.yml)*
EOF

- name: Commit and push changes
- name: 提交并推送
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"

git add .github/KEEPALIVE.md

# 只有文件变化时才提交
if git diff --staged --quiet; then
echo "No changes to commit"
echo "无变更"
else
git commit -m "chore: keepalive at $(date -u +'%Y-%m-%d')"
git push
echo "✅ Keepalive commit pushed successfully"
echo "保活提交成功"
fi
Loading