Skip to content

Commit 018aa6d

Browse files
authored
Merge pull request #108 from zouyonghe/main
修复并完善action
2 parents a980e6e + 0a6215a commit 018aa6d

File tree

5 files changed

+178
-40
lines changed

5 files changed

+178
-40
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Clean Unreachable Plugins
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
clean-unreachable-plugins:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout the repository
11+
uses: actions/checkout@v2
12+
13+
- name: Set up jq and curl
14+
run: |
15+
sudo apt-get update
16+
sudo apt-get install -y jq curl
17+
18+
- name: Clean unreachable plugins
19+
run: |
20+
echo "Cleaning unreachable plugins from plugins.json..."
21+
22+
# 初始化无效插件列表
23+
invalid_plugins=()
24+
25+
# 遍历 plugins.json 的每个键
26+
jq -r 'keys[]' plugins.json | while read -r plugin; do
27+
# 获取 repo 地址
28+
repo=$(jq -r ".[\"$plugin\"].repo" plugins.json)
29+
30+
# 检查 repo 地址的可访问性
31+
if curl --head --silent --fail --max-time 5 "$repo" > /dev/null; then
32+
echo "Plugin $plugin repository is accessible."
33+
else
34+
echo "Plugin $plugin repository is NOT accessible."
35+
invalid_plugins+=("$plugin") # 将无效插件名添加到列表
36+
# 通过 jq 删除插件
37+
jq "del(.\"$plugin\")" plugins.json > temp.json && mv temp.json plugins.json
38+
fi
39+
done
40+
41+
# 打印输出所有无效插件名
42+
if [ ${#invalid_plugins[@]} -ne 0 ]; then
43+
echo "Removed the following unreachable plugins:"
44+
for plugin in "${invalid_plugins[@]}"; do
45+
echo "$plugin"
46+
done
47+
else
48+
echo "No unreachable plugins found."
49+
fi
50+
51+
- name: Output the cleaned plugins.json
52+
run: |
53+
echo "Cleaned plugins.json:"
54+
cat plugins.json
55+
56+
- name: Commit and push changes
57+
run: |
58+
git config --local user.name "github-actions[bot]"
59+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
60+
61+
# 检查是否有需要提交的更改
62+
if [[ $(git status --porcelain) ]]; then
63+
echo "Changes detected. Proceeding to commit and push."
64+
git add plugins.json
65+
git commit -m "Clean unreachable plugins from plugins.json"
66+
git push origin HEAD
67+
else
68+
echo "No changes detected. Skipping commit and push."
69+
fi

.github/workflows/validate_json.yml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ name: Validate plugin.json
33
on:
44
push:
55
paths:
6-
- 'plugin.json'
6+
- 'plugins.json'
77
pull_request:
88
paths:
9-
- 'plugin.json'
9+
- 'plugins.json'
10+
workflow_dispatch: # 支持手动触发
1011

1112
jobs:
1213
validate-json:
@@ -16,7 +17,34 @@ jobs:
1617
- name: Checkout code
1718
uses: actions/checkout@v2
1819

19-
- name: Validate plugin.json format
20+
- name: Validate plugins.json format
2021
run: |
2122
sudo apt-get install jq
22-
jq . plugin.json
23+
jq . plugins.json > /dev/null
24+
25+
- name: Check repository URLs
26+
run: |
27+
# 提取 plugins.json 中的 repo 字段并检查可访问性
28+
repos=$(jq -r '.. | objects | .repo? // empty' plugins.json)
29+
unreachable_urls=() # 初始化一个数组用于记录不可访问的 URL
30+
31+
for repo in $repos; do
32+
if curl --output /dev/null --silent --head --fail "$repo"; then
33+
echo "Repository $repo is accessible."
34+
else
35+
echo "Repository $repo is NOT accessible."
36+
unreachable_urls+=("$repo") # 将不可访问的 URL 添加到数组
37+
fi
38+
done
39+
40+
# 检查是否有不可访问的 URL
41+
if [ ${#unreachable_urls[@]} -ne 0 ]; then
42+
echo "The following repositories are NOT accessible:"
43+
for url in "${unreachable_urls[@]}"; do
44+
echo "$url" # 输出每个不可访问的 URL
45+
done
46+
exit 1 # 结束运行并标记失败状态
47+
else
48+
echo "All repositories are accessible."
49+
fi
50+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea/*

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ AstrBot Plugin 插件集合站,用于在 AstrBot 仪表盘-插件页中作为
44

55
## 提交插件
66

7-
> [!NOTE]
7+
> [NOTE!]
88
> 请点击链接前往 AstrBot 主仓库提交插件:[🥳 发布插件](https://github.com/Soulter/AstrBot/issues/new?template=PLUGIN_PUBLISH.yml)

plugins.json

Lines changed: 75 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,62 @@
33
"desc": "使bot在用户长时间未发送消息时主动与用户对话的插件",
44
"author": "Jason",
55
"repo": "https://github.com/advent259141/astrbot_plugin_InitiativeDialogue",
6-
"tags": ["主动对话"]
6+
"tags": [
7+
"主动对话"
8+
]
79
},
810
"astrbot_plugin_sensoji": {
911
"desc": "这是一个模拟日本浅草寺抽签功能的插件。用户可以通过发送 /抽签 命令随机抽取一个签文,获取运势提示。签文包含吉凶结果(如“大吉”、“凶”等)以及对应的运势描述。",
1012
"author": "Shouugou",
1113
"repo": "https://github.com/Shouugou/astrbot_plugin_sensoji",
12-
"tags": ["抽签", "运势", "浅草寺", "趣味"]
14+
"tags": [
15+
"抽签",
16+
"运势",
17+
"浅草寺",
18+
"趣味"
19+
]
1320
},
1421
"astrbot_plugin_daily_news": {
1522
"desc": "[仅 aiocqhttp] anka - 每日60s新闻推送插件, 请先设置推送目标和时间, 详情见github页面!",
1623
"author": "anka",
1724
"repo": "https://github.com/anka-afk/astrbot_plugin_daily_news",
18-
"tags": ["功能", "推送"]
25+
"tags": [
26+
"功能",
27+
"推送"
28+
]
1929
},
2030
"astrbot_plugin_gemini_exp": {
2131
"desc": "让你在 AstrBot 调用 Gemini2.0-flash-exp 来生成图片或者 P 图。Gemini2.0-flash-exp为原生多模态模型,其既是语言模型,也是生图模型,因此能够对图像使用简单的自然语言命令进行处理。",
2232
"author": "Elen123bot",
2333
"repo": "https://github.com/Elen123bot/astrbot_plugin_gemini_exp",
2434
"social_link": "https://x.com/Alens454635"
2535
},
26-
"astrbot_plugin_nopoke": {
27-
"desc": "[仅 aiocqhttp]不同次数戳一戳的小彩蛋",
28-
"author": "Aligajane",
29-
"repo": "https://github.com/Aligajane/astrbot_plugin_nopoke"
30-
},
3136
"astrbot_plugin_qwq_filter": {
3237
"desc": "QwQ 模型思考内容过滤工具",
3338
"author": "beat4ocean",
34-
"tags": ["qwq", "思考过滤"],
39+
"tags": [
40+
"qwq",
41+
"思考过滤"
42+
],
3543
"repo": "https://github.com/beat4ocean/astrbot_plugin_qwq_filter"
3644
},
3745
"astrbot_plugin_chatsummary": {
3846
"desc": "[仅 aiocqhttp] 一个通过拉取历史聊天记录,调用 LLM 大模型接口实现消息总结功能。",
3947
"author": "laopanmemz",
40-
"tags": ["消息总结", "LLM"],
48+
"tags": [
49+
"消息总结",
50+
"LLM"
51+
],
4152
"social_link": "https://space.bilibili.com/447591776",
4253
"repo": "https://github.com/laopanmemz/astrbot_plugin_chatsummary"
4354
},
4455
"astrbot_plugin_bv": {
4556
"desc": "解析群内 https://www.bilibili.com/video/BV号/ 的链接并获取视频数据与视频文件,以合并转发方式发送",
4657
"author": "haliludaxuanfeng",
4758
"repo": "https://github.com/haliludaxuanfeng/astrbot_plugin_bv",
48-
"tags": ["bilibili"]
59+
"tags": [
60+
"bilibili"
61+
]
4962
},
5063
"astrBot_PGR_Dialogue": {
5164
"desc": "检测到部分战双角色的名称(或别称)时,有概率发送一条语音文本",
@@ -61,7 +74,10 @@
6174
"desc": "摸鱼人日历,支持自定义时间时区,自定义api,支持立即发送,工作日定时发送。",
6275
"author": "quirrel-zh/DuBwTf",
6376
"repo": "https://github.com/DuBwTf/astrbot_plugin_moyurenpro",
64-
"tags": ["功能", "定时任务"]
77+
"tags": [
78+
"功能",
79+
"定时任务"
80+
]
6581
},
6682
"astrbot_plugin_image_understanding_Janus-Pro": {
6783
"desc": "为本地模型提供的图片理解补充,使用deepseek-ai/Janus-Pro系列模型",
@@ -82,7 +98,10 @@
8298
"desc": "AstrBot Wordle 猜单词游戏,支持指定位数",
8399
"author": "Raven95676",
84100
"repo": "https://github.com/Raven95676/astrbot_plugin_wordle",
85-
"tags": ["娱乐", "游戏"]
101+
"tags": [
102+
"娱乐",
103+
"游戏"
104+
]
86105
},
87106
"astr_plugin_bilibili_plus": {
88107
"repo": "https://github.com/rikkasaiko/astr_plugin_bilibili_plus",
@@ -92,7 +111,9 @@
92111
"astrbot_plugin_nofap": {
93112
"desc": "一个用于戒 🦌 记录打卡和查看群内戒 🦌 榜的插件",
94113
"author": "aoz",
95-
"tags": ["功能"],
114+
"tags": [
115+
"功能"
116+
],
96117
"repo": "https://github.com/Aozaky/astrbot_plugin_nofap"
97118
},
98119
"astrbot_plugin_niuniuplus": {
@@ -104,7 +125,9 @@
104125
"desc": "随机推送正在直播的管人直播间",
105126
"author": "Sasaki",
106127
"repo": "https://github.com/Wave233Lee/astrbot_plugin_random_vtb",
107-
"tag": ["娱乐"],
128+
"tag": [
129+
"娱乐"
130+
],
108131
"social_link": "https://space.bilibili.com/11874232"
109132
},
110133
"astrbot_plugin_server_status": {
@@ -131,46 +154,69 @@
131154
"desc": "使大模型更好的主动回复群聊中的消息,带来生动和沉浸的群聊对话体验",
132155
"author": "23q3",
133156
"social_link": "https://space.bilibili.com/396943350",
134-
"tags": ["伪人", "主动回复"],
157+
"tags": [
158+
"伪人",
159+
"主动回复"
160+
],
135161
"repo": "https://github.com/23q3/astrbot_plugin_SpectreCore"
136162
},
137163
"astrbot_plugin_steamshot": {
138164
"desc": "自动检测对话中出现的steam商店页面链接,并返回对应页面的网页截图和摘要信息。",
139165
"author": "inori-3333",
140166
"repo": "https://github.com/inori-3333/astrbot_plugin_steamshot",
141167
"social_link": "https://steamcommunity.com/id/inori_333/",
142-
"tags": ["功能", "游戏", "数据查询", "图片"]
168+
"tags": [
169+
"功能",
170+
"游戏",
171+
"数据查询",
172+
"图片"
173+
]
143174
},
144175
"astrbot_plugin_GGAC_Messenger": {
145176
"desc": "anka - GGAC 作品更新推送插件 - 自动监控并推送 GGAC 平台精选作品的更新! 附赠一套 GGAC 网站完整 api! 还有随机抽取 GGAC 内容功能, 详情见github页面!",
146177
"author": "anka",
147178
"repo": "https://github.com/anka-afk/astrbot_plugin_ggac",
148-
"tags": ["功能", "推送"]
179+
"tags": [
180+
"功能",
181+
"推送"
182+
]
149183
},
150184
"astrbot_plugin_github_cards": {
151185
"logo": "https://blog.soulter.top/assets/avatar.webp",
152186
"desc": "根据聊天中 GitHub 相关链接自动发送 GitHub 仓库简介/issue/pr卡片",
153187
"author": "Soulter",
154188
"repo": "https://github.com/Soulter/astrbot_plugin_github_cards",
155-
"tags": ["功能"]
189+
"tags": [
190+
"功能"
191+
]
156192
},
157193
"astrbot_plugin_hltv": {
158194
"desc": "这是基于 HLTV 网站数据的 CS 赛事查询插件",
159195
"author": "Jason",
160196
"repo": "https://github.com/advent259141/astrbot_plugin_hltv",
161-
"tags": ["功能", "游戏", "数据查询"]
197+
"tags": [
198+
"功能",
199+
"游戏",
200+
"数据查询"
201+
]
162202
},
163203
"astrbot_plugin_moyuren": {
164204
"desc": "每天定时推送摸鱼人日历",
165205
"author": "quirrel-zh",
166206
"repo": "https://github.com/Quirrel-zh/astrbot_plugin_moyuren",
167-
"tags": ["功能", "定时任务"]
207+
"tags": [
208+
"功能",
209+
"定时任务"
210+
]
168211
},
169212
"astrbot_sowing_discord": {
170213
"desc": "[仅限 aiocqhttp 适配器] anka - 自动搬史插件, 1.加入喜欢发史的群聊 2.设置搬史来源 3.设置搬史目标 4.开始全自动搬史!",
171214
"author": "anka",
172215
"repo": "https://github.com/anka-afk/astrbot_sowing_discord",
173-
"tags": ["功能", "搬史"]
216+
"tags": [
217+
"功能",
218+
"搬史"
219+
]
174220
},
175221
"astrbot_plugin_superpoke": {
176222
"desc": "超级戳一戳根据,让戳一戳能够调用其他插件指令",
@@ -191,7 +237,12 @@
191237
"desc": "Astrbot表情包管理器3.0版本已发布! 提供便捷的 WebUI 管理界面(/表情管理 开启管理后台) , 所有 prompt 会根据修改的表情包文件夹目录自动维护,无需手动添加!可以控制每次发送的表情数量和频率(进入设置配置一次发送最大数量与发送概率) 更多信息与功能预览请前往仓库页面, 使用/plugin meme_manager查看所有指令",
192238
"author": "anka",
193239
"repo": "https://github.com/anka-afk/astrbot_plugin_meme_manager",
194-
"tags": ["功能", "meme", "webui", "图床"]
240+
"tags": [
241+
"功能",
242+
"meme",
243+
"webui",
244+
"图床"
245+
]
195246
},
196247
"mccloud_command": {
197248
"desc": "用于修改插件命令的工具,支持备份和恢复,仅限管理员使用。/cmd 查看帮助",
@@ -648,16 +699,5 @@
648699
"author": "长安某",
649700
"desc": "二次元图片签到以及好友买卖,对接牛牛商城,仅支持qq且仅支持非官方bot(其他平台请自行测试)",
650701
"repo": "https://github.com/zgojin/astrbot_plugin_Qsign"
651-
},
652-
"astrbot_plugin_moreVITS ": {
653-
"desc": "硅基流动利用用户的参考音频进行文本转语音的功能,测试中音频文件(测试用的.mp3)可用,内置了一个测试用的三月七(填写api就可用)",
654-
"author": "达莉娅",
655-
"repo": "https://github.com/zhenli12138/astrbot_plugin_moreVITS"
656-
},
657-
"astrbot_plugin_horse_race": {
658-
"desc": "[仅限非官Q] 赛马比赛。快来和群友一起来一场紧张刺激的赛马比赛,用道具搞对手心态,大赚特赚吧",
659-
"author": "达莉娅",
660-
"tags": ["娱乐", "游戏"],
661-
"repo": "https://github.com/zhenli12138/astrbot_plugin_horse_race"
662-
},
702+
}
663703
}

0 commit comments

Comments
 (0)