Dependabot and dependency updates

Intermediate · 28 min

Keep dependencies and Actions current with Dependabot: alerts, security and version updates, a working dependabot.yml, and reviewing its pull requests.

Before thisPull requestsCode review on GitHubConventional Commits and semantic versioningGitHub Pages

Microsoft Learn · 28 min

Dependabot and dependency updates

The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.

Taught by Microsoft LearnReport a problem with this video
Not started
Set this lesson's status

What you'll learn

  • Dependabot has three separate parts: alerts that tell you a dependency is vulnerable, security updates that open a fix pull request, and version updates that keep everything current.
  • Version updates are configured by a .github/dependabot.yml with a package-ecosystem, a directory and a schedule for each ecosystem you want watched.
  • Dependabot opens ordinary pull requests, so your tests, review and branch rules apply to them like any other change.
  • Grouping updates, limiting open pull requests and using a commit-message prefix keep the stream manageable and consistent with your commit conventions.
  • Add the github-actions ecosystem as well, because workflow action versions go stale like any other dependency.

Why dependencies rot

The notes CLI will not stay dependency-free for long. Someone adds a command-line parser, a test helper, a formatter. Each of those is code you did not write and did not review, and it has its own releases. A year later, three things have happened. The libraries have shipped bug fixes you do not have. One of them has a published security hole. And upgrading is now a big job, because you are twelve versions behind instead of one.

Updating a little each week is cheap. Updating once a year is painful. The problem is remembering to do the cheap thing.

Dependabot is GitHub’s bot that remembers for you. It watches your dependency files and opens pull requests when something should change. Because it opens ordinary pull requests, everything you have built so far applies: review, tests, branch rules, merge methods.

Three different features with one name

People say “Dependabot” for three separate things, and it helps to keep them apart. Per GitHub’s docs, which I read on 2026-11-23:

  • Dependabot alerts tell you that a dependency in your graph has a known vulnerability. An alert is information, and it covers every vulnerable dependency in your graph, even ones without a manifest entry.
  • Dependabot security updates are the automatic pull requests that fix those alerted dependencies. The docs say they only trigger for dependencies declared in a manifest or lock file, they raise the dependency to the minimum version that includes the patch, and they link the alert they fix. If no compatible upgrade exists, the alert gets an error instead of a pull request.
  • Dependabot version updates open pull requests to move dependencies to newer versions even when nothing is wrong. This is the one you configure with a file, and it is the one that stops you falling behind.

Security updates do not combine with version updates, and they do not cross package ecosystems.

The configuration file

Version updates are configured by .github/dependabot.yml. For the notes project:

version: 2
updates:
  - package-ecosystem: "npm"
    directory: "/"
    schedule:
      interval: "weekly"
    open-pull-requests-limit: 5
    groups:
      dev-dependencies:
        dependency-type: "development"
    commit-message:
      prefix: "build(deps)"

  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "weekly"
    commit-message:
      prefix: "ci"

I loaded this with a YAML parser, so the syntax is valid. The keys and values come from GitHub’s “Dependabot options reference”. I could not run Dependabot, since it needs a repository on GitHub, so I have not seen the pull requests this file produces. Here is the meaning of each part.

  • version: 2 is always 2.
  • package-ecosystem names the package manager. "npm" and "github-actions" are the exact strings the docs give.
  • directory is where the manifest lives. For GitHub Actions the docs say to use /, and Dependabot looks in .github/workflows itself. There is also a directories key that accepts globs.
  • schedule.interval is how often to check. The docs list daily, weekly, monthly, quarterly, semiannually, yearly and cron.
  • open-pull-requests-limit caps how many version-update pull requests are open at once. The docs say the default is 5.
  • groups combines updates into fewer pull requests. Here, all development dependencies arrive together. Grouping is the main defence against notification fatigue.
  • commit-message.prefix puts a prefix on commit messages and pull request titles. The docs say Dependabot adds a colon after a prefix ending in a letter, number or closing bracket, so build(deps) produces titles starting build(deps): .... That fits the Conventional Commits shape.

Honestly, with the notes project’s current package.json the npm entry would do nothing, because it declares no dependencies yet. The github-actions entry is the useful one now, because the workflows you write in the next group reference actions like actions/checkout@v7.

Dependabot also has ignore (skip a dependency or an update type), labels (the docs say each pull request carries a dependencies label plus one for its ecosystem unless you override them), and cooldown. The docs I read say Dependabot applies a default cooldown of 3 days to version updates even if you configure nothing, and that this does not apply to security updates. That surprised me. Brand-new releases wait a few days, which helps if a release is pulled quickly. Configure cooldown explicitly if you want a different delay.

Reviewing the pull requests

A Dependabot pull request is a change like any other, so treat it that way.

  1. Let the tests run. Dependabot does not know whether your code works with the new version. A green check on the pull request is the evidence, which is why you set up CI.
  2. Read what changed. The pull request description includes the release notes and changelog of the new version. A patch bump to a test helper rarely needs a deep read. A major bump of something your runtime code uses does.
  3. Merge small and often. Merge the green ones promptly. Left open, they conflict with each other and you are back to a backlog.

A security update’s description may include a compatibility score, which is the share of CI runs in other public repositories that passed when updating between the same versions. The docs are clear that it is a hint and not a guarantee for your project.

With required status checks and a rule that pull requests need review, Dependabot cannot slip changes into main unseen. That is the point of combining it with branch protection.

Turning it on

You can commit .github/dependabot.yml yourself. The docs also describe enabling it from Settings, under Advanced Security, with an Enable button for “Dependabot version updates”, which creates a starter file. I could not check that screen, so look at yours. Alerts and security updates are separate switches in the same area.

What the video covers

Microsoft Learn’s “Configure Dependabot security updates on your GitHub repository | GH-500 | Episode 3” is about 28 minutes and was published around February 2026 (YouTube shows “9 months ago”). It is episode three of five in a series prepping for a GitHub security certification, and its description says it covers Dependabot. I could not read a transcript or chapters. By its title it centres on security updates and alerts, so the dependabot.yml version-updates half of this lesson comes from the docs. Two videos on version updates are linked under deeper: a 38-minute 2025 session by Mickey Gousset on keeping GitHub Actions current, and the 2022 Nilesh Gule video from the first draft, which is older but walks through the configuration file. English is judged from the title, description and the channel. This is a better-maintained source than the 2022 pick, but not a perfect fit.

Where this fits

Dependabot watches your dependencies. The next lesson is about the other thing you must not leak or ship: secrets and vulnerable code. Secret scanning and code security.

Check yourself

  1. 01What is the difference between a Dependabot security update and a version update?

    A security update fixes a dependency with a known vulnerability, triggered by an alert. A version update opens pull requests to move dependencies to newer versions even when nothing is wrong, on the schedule you configure.

  2. 02Where does the Dependabot configuration live and what are its required keys?

    In .github/dependabot.yml. It starts with version: 2 and has an updates list where each entry needs a package-ecosystem, a directory (or directories) and a schedule.interval.

  3. 03Why merge a Dependabot pull request only after the tests pass?

    Dependabot does not know whether your code still works with the new version. The pull request runs your checks, and a green result is the evidence that the upgrade is safe for you.

  4. 04Why list github-actions as an ecosystem?

    Workflows reference actions by version tag. Those versions get fixes and security patches, and Dependabot can open pull requests to bump them just as it does for npm packages.

Go deeper

Notes

Private to you

Esc
↑↓ navigate↵ open? shortcuts

Keyboard shortcuts

Press Esc to close

Anywhere

⌘K
Search and commands
/
Search
?
This sheet
Esc
Close

Reading a lesson

J
Next lesson
K
Previous lesson
B
Bookmark