Skip to content

Commit 17a602e

Browse files
committed
fix(workflow): 修复钉钉token变量名错误
- 修正DINGDING_TOKEN为DINNGDING_TOKEN - 简化钉钉消息生成逻辑 - 移除不必要的JSON格式化
1 parent 5552394 commit 17a602e

1 file changed

Lines changed: 3 additions & 21 deletions

File tree

.github/workflows/report_dingding.yml

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,12 @@ jobs:
5858
- name: Send to DingTalk
5959
if: env.DINGDING_TOKEN != ''
6060
env:
61-
DINGDING_TOKEN: ${{ secrets.DINGDING_TOKEN }}
61+
DINGDING_TOKEN: ${{ secrets.DINNGDING_TOKEN }}
6262
run: |
6363
DATE=${{ steps.date.outputs.date }}
6464
SITE_URL="https://wayyoungboy.github.io/github-trending-reporter/"
6565
REPO_URL="https://github.com/${{ github.repository }}"
6666
67-
# 读取报告内容并进行JSON转义
68-
CONTENT=$(cat "${{ steps.find_report.outputs.report_file }}")
69-
7067
# 使用Python进行安全JSON转义
7168
python3 -c "
7269
import json
@@ -85,28 +82,13 @@ message = {
8582
'msgtype': 'markdown',
8683
'markdown': {
8784
'title': f'每日GitHub趋势报告 - {date}',
88-
'text': f'''### **GitHub趋势每日报告** 🚀
89-
90-
#### **报告日期**: {date}
91-
#### **在线查看**: [查看完整报告]({site_url})
92-
93-
---
94-
95-
**报告内容**:
96-
97-
{content}
98-
99-
---
100-
101-
🔗 [**GitHub Trending Reporter**]({repo_url})
102-
103-
*本报告由GitHub Trending Reporter自动生成*'''
85+
'text': f'### **GitHub趋势每日报告** 🚀\n\n#### **报告日期**: {date}\n#### **在线查看**: [查看完整报告]({site_url})\n\n---\n\n**报告内容**:\n\n{content}\n\n---\n\n🔗 [**GitHub Trending Reporter**]({repo_url})\n\n*本报告由GitHub Trending Reporter自动生成*'
10486
}
10587
}
10688

10789
# 输出JSON到文件
10890
with open('dingtalk_message.json', 'w', encoding='utf-8') as f:
109-
json.dump(message, f, ensure_ascii=False, indent=2)
91+
json.dump(message, f, ensure_ascii=False)
11092
" "$DATE" "$SITE_URL" "$REPO_URL"
11193

11294
# 发送消息

0 commit comments

Comments
 (0)