Dependabot is an automation service that will automatically create PRs to keep your projects' dependencies up to date, and it is fucking wonderful.
In just a few, sweet, wonderful minutes, you can install and configure it to automatically keep an eye on your project dependencies, and set a daily or weekly schedule to submit updates and changes. Automation at its finest - dependabot is like having a super mindful teammate who keeps an eye on npm (or pip or rubygems or one of many other languages) - you'll automatically get great, well-formed PRs for each dependency version bump, which you can test locally, or have sent up to your CI toolchain of choice.
After you run through the setup process, dependabot will monitor your repo and submit PRs to update individual dependencies on a daily or weekly rhythm (your choice!). If the PR contains an important security update, it will be assigned a label of Security
, too.
Honestly, for me, it's like adding a member to my team. I love automation, and I love making my life simpler. Until now, for all of my projects, myself or another teammate would regularly run through all the dependencies in a given repo, and manually update them one at a time, testing and pushing them to GitHub to be run through CI and then eventually merged by the team. The honest truth is that this process can take quite a while, and can be forgotten, and isn't mindful of important security updates at all. That's all over now.
What else?
There are a ton of other features available to you the moment you install dependabot. It responds to a wide variety of commands by way of GitHub comment. In the screenshot above, I've approved a PR and asked dependabot to merge it as soon as CI has passed. Now I don't have to babysit the repo in order to merge updates! Sweet!
If your repo contains multiple languages, Dependabot can handle that. If you've got a complex monorepo with multiple files representing your dependencies (for example, a node project set up with Lerna), dependabot can monitor each dependency file individually, with different rules for each.
A free lunch, though
This was the final kicker for me. Dependabot was just acquired by GitHub, and is now available completely free for use. That's incredible! There's no reason for you not to give it a shot. Go check it out now, post haste!
Go install Dependabot!
Note: the cover photo for this article comes from one of my favorite photographers, Alex Knight, and was made available un Unsplash. Thank you Alex for your work! Go support him on Patreon, and give him a follow on Twitter.
Top comments (8)
Installed the shit out of this just now. LOVE it. Thank you so much!
You're welcome! I'm on an install-spree myself. I'm going to need someone to make a @dependabot-bot, to manage bot-related chores for me 🤖📋
I discovered since the aquisition you can also configure the automatic PRs for security updates directly in Github:
help.github.com/en/articles/config...
I believe it uses Dependabot still and can be a lower friction avenue for getting some of these benefits.
We use it in our repo, here's an example:
Bump aws-sdk-lambda from 1.25.0 to 1.26.0 #2970
Bumps aws-sdk-lambda from 1.25.0 to 1.26.0.
Changelog
Sourced from aws-sdk-lambda's changelog.
Commits
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot ignore this [patch|minor|major] version
will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)@dependabot use these labels
will set the current labels as the default for future PRs for this repo and language@dependabot use these reviewers
will set the current reviewers as the default for future PRs for this repo and language@dependabot use these assignees
will set the current assignees as the default for future PRs for this repo and language@dependabot use this milestone
will set the current milestone as the default for future PRs for this repo and language@dependabot badge me
will comment on this PR with code to add a "Dependabot enabled" badge to your readmeAdditionally, you can set the following in your Dependabot dashboard:
Finally, you can contact us by mentioning @dependabot.
We have been on it for a while and really love it!
Do you have a strategy for keeping up with Dependabot's PRs? Something like a team member or a daily shared task to manage the work?
We restrict it to weekly PRs, which helps batch things better. We don't have to have much of a strategy otherwise because we have a pretty well-looked-after CI process and it's not too much of a burden on the rest of our setup.
Right on. I think I'll be switching to a weekly cadence for all of my projects as well. A well-looked-after CI process is something I need more of in my life 👀
I have just started to use this, it also provides updates lower-level dependencies which are usually not in the "package.json". How safe it is to rely on the compatibility mentioned by the bot?