Compare commits

..

1 Commits

Author SHA1 Message Date
WrBug 1b4ff3cd7a fix(ci): 加固合并 PR 后 Telegram 通知步骤
将 Issue 元数据经 env 注入,并用 jq 组装 MESSAGE,避免标题中的引号、
换行或 shell 元字符破坏生成的 run 脚本或正文拼接。

Made-with: Cursor
2026-03-30 12:58:12 +08:00
3 changed files with 11 additions and 33 deletions
+11 -7
View File
@@ -91,6 +91,11 @@ jobs:
env:
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
# 经 env 注入,避免 Issue 标题等含引号/换行/$ 时被写入 run 脚本导致截断或语法错误
ISSUE_NUM: ${{ steps.pr.outputs.ISSUE_NUMBER }}
ISSUE_TITLE: ${{ steps.issue.outputs.title }}
ISSUE_URL: ${{ steps.issue.outputs.url }}
PR_URL: ${{ github.event.pull_request.html_url }}
run: |
# 与 docker-build 一致:未配置则跳过
if [ -z "$TELEGRAM_BOT_TOKEN" ] || [ -z "$TELEGRAM_CHAT_ID" ]; then
@@ -98,13 +103,12 @@ jobs:
exit 0
fi
ISSUE_NUM="${{ steps.pr.outputs.ISSUE_NUMBER }}"
ISSUE_TITLE="${{ steps.issue.outputs.title }}"
ISSUE_URL="${{ steps.issue.outputs.url }}"
PR_URL="${{ github.event.pull_request.html_url }}"
# 与 docker-build 相同的 HTML 消息格式
MESSAGE="✅ <b>AI 修复的 Issue 已关闭</b>"$'\n'$'\n'"🔢 <b>Issue:</b> #${ISSUE_NUM} ${ISSUE_TITLE}"$'\n'"📎 <a href=\"${ISSUE_URL}\">查看 Issue</a>"$'\n'"🔗 <a href=\"${PR_URL}\">查看 PR</a>"
MESSAGE=$(jq -n -r \
--arg num "$ISSUE_NUM" \
--arg title "$ISSUE_TITLE" \
--arg iu "$ISSUE_URL" \
--arg pu "$PR_URL" \
'"✅ <b>AI 修复的 Issue 已关闭</b>\n\n🔢 <b>Issue:</b> #" + $num + " " + $title + "\n📎 <a href=\"" + $iu + "\">查看 Issue</a>\n🔗 <a href=\"" + $pu + "\">查看 PR</a>"')
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
-H "Content-Type: application/json" \
View File
-26
View File
@@ -1,26 +0,0 @@
# Fix for Issue #89: Fix responsive design on mobile
## Issue Description
Fix responsive design on mobile
## Fix Implementation
Demo implementation for issue #89.
## Changes Made
- Fixed authentication bug in login component
- Updated API endpoint to handle user profiles correctly
- Implemented responsive CSS fixes for mobile layout
- Added proper error handling and validation
## Files Modified
- frontend/src/components/Login.js
- backend/routes/api/users.js
- frontend/src/styles/Dashboard.css
- backend/src/middleware/validation.js
## Testing Results
- Frontend compilation: ✅
- Backend compilation: ✅
- Unit tests: ✅ (12/12 passed)
- Integration tests: ✅ (8/8 passed)
- Browser tests: ✅ (Chrome, Firefox, Safari)