Renovate Bot月度执行配置异常:PR频繁生成而非按月触发
问题排查与配置修正
核心问题分析
- 文件匹配逻辑完全错误:你的
pip_requirements配置里,fileMatch仅针对requirements.txt.internal,还通过ignorePaths排除了requirements.txt——这和你要扫描两个文件的需求完全相反。Renovate会对未被明确纳入配置的文件使用默认扫描频率(每日),导致PR频繁生成。 - 规则未完全遵循调度:虽然全局设置了月度扫描计划,但
packageRules中的自动合并规则没有绑定调度,可能在新版本检测后立即触发PR,绕过了月度限制。
修正后的配置
{ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "python": { "registryUrls": ["https://pypi.org/simple", "https://XXXXXX.com/repository/pypi/simple"] }, "pip_requirements": { "fileMatch": ["^requirements.txt$", "^requirements.txt.internal$"] }, "schedule": ["before 3am on the first day of the month"], "prConcurrentLimit": 100, "prHourlyLimit": 100, "docker": { "schedule": ["before 3am on the first day of the month"] }, "packageRules": [ { "matchUpdateTypes": ["major", "minor", "patch", "digest"], "automerge": true, "schedule": ["before 3am on the first day of the month"] } ] }
修正说明
- 移除
pip_requirements下的ignorePaths,并更新fileMatch包含两个目标文件,确保Renovate只处理你指定的依赖文件,避免默认扫描其他文件。 - 给
packageRules添加相同的月度调度,确保自动合并操作也遵循月度周期,防止新版本检测后立即生成PR。 - 全局调度保持不变,确保所有模块(包括pip依赖和docker镜像)都统一使用月度扫描规则。
内容的提问来源于stack exchange,提问作者Swapnil Jadhav
相关产品推荐
相关产品推荐

