(changedFiles, repoName)
| 153 | |
| 154 | // 从文件路径提取插件名 |
| 155 | function extractPluginNames(changedFiles, repoName) { |
| 156 | const plugins = new Set(); |
| 157 | |
| 158 | changedFiles.forEach(filePath => { |
| 159 | // 处理 TeleBox-Plugins 仓库的插件文件 |
| 160 | if (repoName === 'TeleBox-Plugins') { |
| 161 | // 插件目录直接包含插件名 |
| 162 | const pluginMatch = filePath.match(/^([a-zA-Z_]+)\//); |
| 163 | if (pluginMatch) { |
| 164 | plugins.add(pluginMatch[1]); |
| 165 | } |
| 166 | // 根目录下的 .ts 文件也是插件 |
| 167 | const rootPluginMatch = filePath.match(/^([a-zA-Z_]+)\.ts$/); |
| 168 | if (rootPluginMatch) { |
| 169 | plugins.add(rootPluginMatch[1]); |
| 170 | } |
| 171 | // plugins 目录下的插件 |
| 172 | const pluginsMatch = filePath.match(/^plugins\/([a-zA-Z_]+)\.ts$/); |
| 173 | if (pluginsMatch) { |
| 174 | plugins.add(pluginsMatch[1]); |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | // 处理 TeleBox 仓库的插件文件 |
| 179 | if (repoName === 'TeleBox') { |
| 180 | // src/plugin 目录下的插件 |
| 181 | const srcPluginMatch = filePath.match(/^src\/plugin\/([a-zA-Z_]+)\.ts$/); |
| 182 | if (srcPluginMatch) { |
| 183 | plugins.add(srcPluginMatch[1]); |
| 184 | } |
| 185 | // plugins 目录下的插件 |
| 186 | const pluginsMatch = filePath.match(/^plugins\/([a-zA-Z_]+)\.ts$/); |
| 187 | if (pluginsMatch) { |
| 188 | plugins.add(pluginsMatch[1]); |
| 189 | } |
| 190 | } |
| 191 | }); |
| 192 | |
| 193 | return Array.from(plugins); |
| 194 | } |
| 195 | |
| 196 | // 去重和过滤提交信息 |
| 197 | function deduplicateCommits(commits) { |
no test coverage detected