All guides

Dependabot or Renovate: keeping dependencies current

Dependabot is built into GitHub. Renovate needs an app installation or self-hosting and works on several platforms. Both open pull requests that update dependencies, and both have settings that reduce how many you receive.

A laptop on a desk beside stacks of books and a lamp

Two kinds of update

GitHub's documentation separates two kinds of Dependabot pull request.

  • Security updates are for vulnerable dependencies. Dependabot can create them with no configuration file, once you have enabled Dependabot security updates in the repository settings.
  • Version updates keep dependencies current on a schedule. You get them only with a dependabot.yml file.

Dependabot

The file must be stored on the default branch at .github/dependabot.yml or .github/dependabot.yaml.

YAML

version: 2
updates:
  - package-ecosystem: "npm"
    directory: "/"
    schedule:
      interval: "weekly"
    open-pull-requests-limit: 5
    cooldown:
      default-days: 7
    groups:
      dev-minor-patch:
        dependency-type: "development"
        update-types: ["minor", "patch"]
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "weekly"

version, updates, package-ecosystem, directory and schedule.interval are required. The interval is daily, weekly, monthly, quarterly, semiannually, yearly or cron. The other keys change documented defaults:

  • Without groups, Dependabot opens a single pull request for each dependency. With a group, all updates that match its rule are combined in one pull request.
  • When five pull requests with version updates are open, Dependabot raises no more until some are merged or closed. open-pull-requests-limit changes that number, and the 5 in this example repeats the default. Security updates have a separate, fixed limit of 10.
  • Version updates have a default cooldown of 3 days: a new release is not considered until 3 days after it came out. cooldown changes the period, and the 7 here is a value to choose yourself. The cooldown does not apply to security updates.
  • multi-ecosystem-groups combines updates from several package ecosystems, such as Docker and Terraform, into a single pull request.

For automerge, GitHub's documentation shows a workflow that uses the dependabot/fetch-metadata action and runs gh pr merge --auto on the pull request.

Renovate

Renovate is licensed under the GNU Affero General Public License. Its comparison page lists the supported platforms as Azure, Bitbucket, Forgejo, Gitea, GitHub, GitLab and SCM-Manager.

Renovate first creates an onboarding pull request. You merge it to activate Renovate. The configuration lives in renovate.json:

JSON

{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": ["config:recommended"],
  "schedule": ["* 0-3 * * 1"],
  "minimumReleaseAge": "3 days",
  "packageRules": [
    {
      "matchDepTypes": ["devDependencies"],
      "matchUpdateTypes": ["minor", "patch"],
      "automerge": true
    }
  ],
  "major": {
    "dependencyDashboardApproval": true
  }
}

The schedule and the release age are yours to change. This schedule means Monday mornings before 4 AM, and Renovate's default time zone is UTC. Three features to know:

  • Presets. To use a preset, put it in the extends array. Presets are hosted in repositories. For a reference such as github>my-org/renovate-config, Renovate looks for a default.json file in that repository.
  • Automerge. By default, Renovate raises pull requests and leaves the merge to someone else. With automerge, it waits for the required tests to pass and then merges. It automerges only one branch per target branch per run, and the rest wait for the next run.
  • The Dependency Dashboard. It is an issue in the repository that lists all pull requests pending, open, closed unmerged or in error. It is enabled as part of the config:recommended preset. With dependencyDashboardApproval, Renovate waits for your approval, given by selecting a checkbox in that issue, before it creates the branch or pull request.

minimumReleaseAge makes Renovate wait a set time before it suggests an update. While a release is younger than that, Renovate adds a pending status check to the update's branch.

How to choose

  • Dependabot is built into GitHub, so there is no app to install or host. Choose it when your code is on GitHub and groups and schedule cover what you need.
  • Renovate's comparison page lists what it adds: the Dependency Dashboard, for which Dependabot has no similar feature, community-provided groups, and support for platforms other than GitHub. Choose it when you need one of those, or automerge as a configuration option.

Fewer pull requests

  1. Group. Both tools combine related updates into one pull request. Renovate's documentation names the cost: a grouped branch has a higher chance of an error, and finding the package that broke the build takes longer.
  2. Schedule. Set schedule.interval in Dependabot. Renovate's comparison page says that by default it runs as frequently as it is allowed to, so set schedule there as well.
  3. Wait. Use cooldown in Dependabot and minimumReleaseAge in Renovate.
  4. Cap. Dependabot has open-pull-requests-limit. Renovate has prConcurrentLimit for open pull requests and prHourlyLimit for the rate at which it creates them. Its documentation says a missing hourly limit may cause Renovate's pull requests to overwhelm your CI systems.
  5. Automerge. Renovate's maintainers recommend automerge for any update where you would select merge anyway. They add that for production dependencies your project should have good test coverage.

What to check

  • When either Dependabot limit is reached, it reports an error and stops opening pull requests until some of the open ones are merged or closed.
  • Renovate always creates security pull requests, even when the concurrent limit is reached. They have [SECURITY] in the title.
  • Renovate cannot automerge the second a pull request passes its tests. Its documentation says to give it about two hours before you start troubleshooting.

Sources

Want a second pair of eyes on yours? We do this work for a living.

Book a call

More guides