You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在GitHub中过滤掉Dependabot通知?

过滤GitHub中非Dependabot通知的替代方案

虽然GitHub官方自定义过滤器不支持直接排除特定作者的通知,但可以通过以下几种实用方法实现仅查看人类生成通知的需求:

  • 使用GitHub通知搜索语法:在GitHub通知页面的搜索框中输入-author:dependabot,即可直接过滤掉所有Dependabot发布的通知。如果需要快速访问,可以将这个搜索结果页面添加为浏览器书签,下次打开即可直接查看过滤后的内容。

  • 浏览器用户脚本(Tampermonkey/Greasemonkey):编写简单脚本自动隐藏Dependabot通知,适合需要自动过滤的场景。示例脚本如下:

// ==UserScript==
// @name         Hide Dependabot Notifications on GitHub
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  隐藏GitHub通知栏中的Dependabot通知
// @author       自定义
// @match        https://github.com/notifications*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    const hideDependabot = () => {
        // 匹配包含Dependabot标识的通知项
        document.querySelectorAll('.notifications-list-item:has([aria-label*="Dependabot"])').forEach(item => {
            item.style.display = 'none';
        });
    };
    // 页面加载后执行一次
    hideDependabot();
    // 监听页面动态加载(GitHub通知为异步加载)
    const observer = new MutationObserver(hideDependabot);
    const targetNode = document.querySelector('.js-notifications-list');
    if (targetNode) {
        observer.observe(targetNode, { childList: true, subtree: true });
    }
})();

安装Tampermonkey扩展后添加该脚本,即可自动隐藏所有Dependabot通知条目。

  • 优化Dependabot自身配置减少通知:从源头减少不必要的通知,在仓库的.github/dependabot.yml文件中可做如下调整:
    • 设置open-pull-requests-limit参数,限制Dependabot同时打开的更新PR数量
    • 修改schedule.interval为weekly或monthly,降低依赖检查的频率
    • 添加ignore规则,排除不需要更新的依赖包或特定版本的依赖

内容的提问来源于stack exchange,提问作者slifty

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.29 13:57:20