Welcome to the public home of Dependabot :dependabot:.
Dependabot-Core is the library at the heart of Dependabot security / version updates.
Use it to generate automated pull requests updating dependencies for projects written in Ruby, JavaScript, Python, PHP, Dart, Elixir, Elm, Go, Rust, Java and .NET. It can also update git submodules, Docker files, and Terraform files. Features include:
Most people are familiar with the Dependabot service that runs on GitHub.com and GitHub Enterprise. Enabling that is as
simple as checking a dependabot.yml configuration file in to your repository's .github directory.
However, if you want to run a custom version of Dependabot or run it on another platform, you're not left out in the cold. This repo provides the logic necessary for hosting your own standalone Dependabot. It currently supports opening Pull Requests against repositories hosted on GitHub, Github Enterprise, Azure DevOps, GitLab, BitBucket, and AWS CodeCommit.
Dependabot-Core is a library, so you'll need an entrypoint script of some kind. Here are a few examples to help you get started.
Note: If you're looking to run Dependabot locally for development/debugging purposes, see the Development Guide.
The dependabot-script repo provides a collection of example scripts for configuring the Dependabot-Core library. It is intended as a starting point for advanced users to run a self-hosted version of Dependabot within their own projects.
Note: We recently refactored the monolithic docker image used within the Dependabot Core library into one-image-per-ecosystem. Unfortunately, that broke dependabot-scripts, and we haven't had time to update them yet. We are aware of the problem and hope to provide a solution soon.
The Dependabot CLI is a newer tool that may eventually replace dependabot-script for standalone use cases.
While it creates dependency diffs, it's currently missing the logic to turn those diffs into actual PRs. Nevertheless, it
may be useful for advanced users looking for examples of how to hack on Dependabot.
In an environment such as GitHub where Dependabot is running in a container, if you want to change your build or installation process depending on whether Dependabot is checking, you can determine it by the existence of DEPENDABOT environment variable.
👋 Want to give us feedback on Dependabot, or contribute to it? That's great - thank you so much!
Most bug reports should be accompanied by a link to a public repository that reproduces the problem. Bug reports that cannot be reproduced on a public repo using the CLI tool or dry-run script may be closed as "cannot reproduce".
Our issue tracker is quite active, and as a result there's a good chance someone already filed the same issue. If so, please upvote that issue, because we use 👍 reactions on issues as one signal to gauge the impact of a feature request or bug.
However, please do not leave comments that contribute nothing new to the discussion. For details, see https://github.com/golang/go/wiki/NoPlusOne. This is open source, if you see something you want fixed, we are happy to coach you through contributing a pull request to fix it.
The issue-tracker is meant solely for issues related to Dependabot's updating logic. Issues about security alerts or Dependency Graph should instead be filed as a Code Security discussion.
A good rule of thumb is that if you have questions about the diff in a PR, it belongs here.
If you believe you have found a security vulnerability in Dependabot, please review our security policy for details about disclosing them to the GitHub Bug Bounty program, so we can work to resolve the issue before it is disclosed publicly.
Want to contribute to Dependabot? That's great - thank you so much!
Contribution workflow:
Please refer to the CONTRIBUTING guidelines for more information.
If you're interested in contributing support for a new ecosystem, please refer to the contributing guidelines for more information.
The first step to debugging a problem or writing a new feature is getting a development environment going. We provide a custom Docker-based developer shell that bakes in all required dependencies. In most cases this is the best way to work with the project.
The developer shell uses volume mounts to incorporate your local changes to Dependabot's source code. This way you can edit locally using your favorite editor and the changes are immediately reflected within the docker container for performing dry-runs or executing tests. Note: See caveat about editing the native package manager helper scripts.
The script to launch the developer shell builds the docker images from scratch if it can't find them locally. This can take a while.
Skip the wait by pulling the pre-built image for the ecosystem you want to work on. The image name uses the YAML ecosystem name
to specify the ecosystem. For example, for Go Modules, the YAML name is gomod:
$ docker pull ghcr.io/dependabot/dependabot-updater-gomod
Note: Pre-built images are currently only available for AMD64 / Intel architecture. They will run on ARM, but 2x-3x slower than if you manually build ARM-specific images.
Next, run the developer shell, specifying the desired ecosystem using the top-level directory name of the ecosystem in this project. For example, for Go Modules, the top-level directory is named go_modules:
$ bin/docker-dev-shell go_modules => running docker development shell [dependabot-core-dev] ~ $ cd go_modules && rspec spec # to run tests for a particular package
Normally the Quickstart is all you need, but occasionally you'll need to rebuild the underlying images.
For example, while we don't yet publish ARM-specific images, if you are working on an ARM-based platform, we recommend manually building the images because the resulting containers run much faster.
The developer shell runs within a Dependabot Development docker image, which is built on top of an ecosystem image.
flowchart LR A["docker-dev-shell script"] --> B("Dependabot Development docker image") B --> C("Dependabot Updater Ecosystem docker image (ecosystem specific)") C --> D("Dependabot Updater Core docker image")
Changes to the docker files for any of these images requires building one or more of the images locally in order to be reflected in the development shell.
The simple but slow way is to delete any existing images and then run bin/docker-dev-shell which automatically builds
missing images.
The faster way is to pull all the pre-built images that are dependencies of the image you actually need to build. To (re)build a specific one:
The Updater core image:
$ docker pull ghcr.io/dependabot/dependabot-updater-core # OR $ docker build -f Dockerfile.updater-core . # recommended on ARM
The Updater ecosystem image:
$ docker pull ghcr.io/dependabot/dependabot-updater-gomod # OR $ script/build go_modules # recommended on ARM
The development container using the --rebuild flag:
$ bin/docker-dev-shell go_modules --rebuild
Several Dependabot packages make use of 'native helpers', small executables in their host language.
Changes to these files are not automatically reflected inside the development container.
Once you have made any edits to the helper files, run the appropriate build script to update the installed version with your changes like so:
$ bin/docker-dev-shell bundler => running docker development shell $ bundler/helpers/v2/build $ bin/dry-run.rb bundler dependabot/demo --dir="/ruby"
To view logs and stdout from the native package manager helpers, see debugging native helpers.
The first step to debugging is getting the development environment running.
Within the development environment, you have two options for simulating a dependency update job: You can use the newly-developed CLI tool or the original Dry-run script.
The Dependabot CLI is a newly-developed tool that incorporates the GitHub Credentials Proxy to more realistically simulate what's happening within the Dependabot-at-GitHub service when talking to private registries.
It has a dedicated debugging guide, including support for dropping into the Ruby debugger.
Note: Before running the dry-run script, you'll need to get the development environment running.
You can use the bin/dry-run.rb script to simulate a dependency update job, printing
the diff that would be generated to the terminal. It takes two positional
arguments: the package manager and the GitHub repo name (including the
account):
$ bin/docker-dev-shell go_modules => running docker development shell $ bin/dry-run.rb go_modules rsc/quote => fetching dependency files => parsing dependency files => updating 2 dependencies ...
The Dry-Run script supports many other options, all of which are documented at the top of the script's source code. For example:
LOCAL_GITHUB_ACCESS_TOKEN="fake-GitHub-PAT" allows specifying a GitHub Personal Access Token (PAT) to avoid rate-limiting.--dir="path/to/subdir/containing/manifest is required if the manifest file is located in a subdirectory.--dep="dep-name-that-I-want-to-test" allows specifying a single dep to try to update and all others are ignored.--cache=files allows caching remote dep files locally for faster re-runs when testing local logic changes.--updater-options=feature_flag_name allows passing in feature flags.Here's an example of how to string all these together
LOCAL_GITHUB_ACCESS_TOKEN=github_pat_123_fake_string \ bin/dry-run.rb docker jeffwidman/secrets-store-driver \ --dir "/manifest_staging/charts/secrets-store-provider" \ --cache=files \ --dep="secrets-store" \ --updater-options=kubernetes_updates
You can add a debugger statement anywhere in the ruby code, for example:
def latest_resolvable_version debugger latest_version_finder.latest_version end
When you execute the job, the Ruby debugger will open. It should look something like this:
[11, 20] in ~/go_modules/lib/dependabot/go_modules/update_checker.rb 11| module GoModules 12| class UpdateChecker < Dependabot::UpdateCheckers::Base 13| require_relative "update_checker/latest_version_finder" 14| 15| def latest_resolvable_version => 16| debugger 17| latest_version_finder.latest_version 18| end 19| 20| # This is currently used to short-circuit latest_resolvable_version, =>#0 Dependabot::GoModules::UpdateChecker#latest_resolvable_version at ~/go_modules/lib/dependabot/go_modules/update_checker.rb:16 #1 Dependabot::GoModules::UpdateChecker#latest_version at ~/go_modules/lib/dependabot/go_modules/update_checker.rb:24 # and 9 frames (use `bt' command for all frames) (rdbg)
At this prompt, you can run debugger commands to navigate around, or enter methods and variables to see what they contain. Try entering dependency to see what dependency Dependabot is currently working on.
Note While in the debugger, changes made to the source code will not be picked up. You will have to end your debugging session and restart it.
When you're debugging an issue you often need to peek inside these scripts that run in a separate process.
Print all log statements from native helpers using DEBUG_HELPERS=true:
DEBUG_HELPERS=true bin/dry-run.rb bundler dependabot/demo --dir="/ruby"
Pause execution to debug a single native helper function using DEBUG_FUNCTION=<function name>. The function maps to a
native helper function name, for example, one of the functions in bundler/helpers/v2/lib/functions.rb.
When this function is being executed a debugger is inserted, pausing execution of the bin/dry-run.rb script, this leaves the current updates tmp directory in place allowing you to cd into the directory and run the native helper function directly:
DEBUG_FUNCTION=parsed_gemfile bin/dry-run.rb bundler dependabot/demo --dir="/ruby" => fetching dependency files => dumping fetched dependency files: ./dry-run/dependabot/demo/ruby => parsing dependency files $ cd /home/dependabot/dependabot-core/tmp/dependabot_TEMP/ruby && echo "{\"function\":\"parsed_gemfile\",\"args\":{\"gemfile_name\":\"Gemfile\",\"lockfile_name\":\"Gemfile.lock\",\"dir\":\"/home/dependabot/dependabot-core/tmp/dependabot_TEMP/ruby\"}}" | BUNDLER_VERSION=1.17.3 BUNDLE_GEMFILE=/opt/bundler/v1/Gemfile GEM_HOME=/opt/bundler/v1/.bundle bundle exec ruby /opt/bundler/v1/run.rb
Copy and run the


免费创建高清无水印Sora视频
Vora是一个免费创建高清无水印Sora视频的AI工具


最适合小白的AI自动化工作流平台
无需编码,轻松生成可复用、可变现的AI自动化工作流

大模型驱动的Excel数据处理工具
基于大模型交互的表格处理系统,允许用户通过对话方式完成数据整理和可视化分析。系统采用机器学习算法解析用户指令,自动执行排序、公式计算和数据透视等操作,支持多种文件格式导入导出。数据处理响应速度保持在0.8秒以内,支持超过100万行数据的即时分析。


AI辅助编程,代码自动修复
Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。


AI论文写作指导平台
AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速 生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。


AI一键生成PPT,就用博思AIPPT!
博思AIPPT,新一代的AI生成PPT平台,支持智能生成PPT、AI美化PPT、文本&链接生成PPT、导入Word/PDF/Markdown文档生成PPT等,内置海量精美PPT模板,涵盖商务、教育、科技等不同风格,同时针对每个页面提供多种版式,一键自适应切换,完美适配各种办公场景。


AI赋能电商视觉革命,一站式智能商拍平台
潮际好麦深耕服装行业,是国内AI试衣效果最好的软件。使用先进AIGC能力为电商卖家批量提供优质的、低成本的商拍图。合作品牌有Shein、Lazada、安踏、百丽等65个国内外头部品牌,以及国内10万+淘宝、天猫、京东等主流平台的品牌商家,为卖家节省将近85%的出图成本,提升约3倍出图效率,让品牌能够快速上架。


企业专属的AI法律顾问
iTerms是法大大集团旗下法律子品牌,基于最先进的大语言模型(LLM)、专业的法律知识库和强大的智能体架构,帮助企业扫清合规障碍,筑牢风控防线,成为您企业专属的AI法律顾问。


稳定高效的流量提升解决方案,助力品牌曝光
稳定高效的流量提升解决方案,助力品牌曝光


最新版Sora2模型免费使用,一键生成无水印视频
最新版Sora2模型免费使用,一键生成无水印视频
最新AI工具、AI资讯
独家AI资源、AI项目落地

微信扫一扫关注公众号