Skip to main content

CI/CD and automation · Intermediate · 15 min

Keep dependencies up to date with Renovate

By Padding · Updated 18 Nov 2026
GitHub · Renovate 45.0.2 · Node.js 26.13.1 (node:26)

You will write and validate a renovate.json that groups dev dependency updates, automerges patches after checks pass, runs on Monday mornings Lagos time, waits out brand-new releases and pins GitHub Actions by digest, then preview its pull requests locally before turning it on for a repository.

On this page

Outdated dependencies pile up quietly. One month you are a patch behind, a year later you are two majors behind with a security fix you cannot apply without a week of upgrade work. Renovate reads your package files, checks the registries, and opens a pull request for each update, so the upgrade happens in small steps that your tests can judge.

Left on its defaults, Renovate can also open a lot of pull requests. In this tutorial you will shape it so it fits a small team: dev tools arrive as one grouped pull request, patch updates merge themselves once your checks pass, everything lands on Monday morning in Lagos time, releases younger than three days are left alone, and your GitHub Actions are pinned to exact commits. You will check each change with Renovate's own validator and preview the pull requests on your computer before Renovate touches the repository.

The version used here is Renovate 45.0.2. If you would rather use GitHub's built-in tool, see /tutorials/configure-dependabot-version-and-security-updates; the two do the same job, and you should run only one of them on a repository.

Step 1 · Create a small project to keep up to date

Renovate needs something to update. Make a throwaway project with one runtime dependency, two dev dependencies and a workflow file, all pinned to versions that are already behind:

Bash
mkdir -p ~/renovate-demo/.github/workflows
cd ~/renovate-demo
git init

cat > package.json <<'JSON'
{
  "name": "renovate-demo",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "test": "node --test"
  },
  "dependencies": {
    "express": "5.1.0"
  },
  "devDependencies": {
    "eslint": "9.30.0",
    "prettier": "3.5.0"
  }
}
JSON

cat > .github/workflows/test.yml <<'YAML'
name: Test

on:
  pull_request:
  push:
    branches: [main]

permissions:
  contents: read

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v7
        with:
          node-version: 26
      - run: npm test
YAML

printf 'node_modules\ndry-run.log\n' > .gitignore

If you are following along in a real project instead, skip this step and run the rest from your project's root folder.

Check it worked

Bash
npm pkg get dependencies devDependencies
ls .github/workflows

npm prints the three packages with their versions, and the second command lists test.yml. Those three packages and the two actions in the workflow are what Renovate will look after (Renovate also picks up the node-version in the setup-node step).

Step 2 · Write a first renovate.json and validate it

Renovate reads its settings from renovate.json in the repository root. Start with the shared preset most projects use, config:recommended. It turns on the Dependency Dashboard issue, groups packages that are released together (such as everything in the ESLint monorepo) and adds other sensible defaults:

Bash
cat > renovate.json <<'JSON'
{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": ["config:recommended"]
}
JSON

The $schema line lets editors such as VS Code autocomplete and flag option names while you type.

Now validate it. Renovate ships a separate program, renovate-config-validator, in the same npm package. npx downloads Renovate 45.0.2 into npm's cache the first time (a few hundred megabytes, so on a metered or prepaid connection do this once on good Wi-Fi; later runs reuse the cache):

Bash
npx --yes --package renovate@45.0.2 -- renovate-config-validator

Check it worked

The validator prints a line naming renovate.json and then a success message, something like Config validated successfully, and exits with code 0. Any warning or error makes it exit non-zero, which is what you want in a CI job.

Step 3 · Group dev dependencies and automerge patches

Two rules cut most of the noise. Package rules match updates and change how Renovate treats them. The first puts minor and patch updates of dev dependencies into one pull request. The second lets patch updates of anything merge without you, once your checks pass:

Bash
cat > renovate.json <<'JSON'
{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": ["config:recommended"],
  "packageRules": [
    {
      "description": "One pull request for minor and patch updates of dev tools",
      "matchDepTypes": ["devDependencies"],
      "matchUpdateTypes": ["minor", "patch"],
      "groupName": "dev dependencies"
    },
    {
      "description": "Merge patch updates once checks pass",
      "matchUpdateTypes": ["patch"],
      "automerge": true
    }
  ]
}
JSON
npx --yes --package renovate@45.0.2 -- renovate-config-validator

Rules apply in order, and a later rule adds to an earlier one. A patch update of prettier matches both: it goes into the grouped pull request, and that pull request automerges only if every update in it is a patch. Major updates match neither rule, so they still arrive one by one and wait for a person. That is deliberate: majors are where breaking changes live.

Automerge is only as safe as your tests. Renovate waits for passing status checks before it merges, and by default it will not automerge a branch that has no checks at all.

Check it worked

The validator again reports success and exits with code 0. Now see it catch a mistake. Write a copy with a typo (matchDepType instead of matchDepTypes) in a scratch folder and validate that:

Bash
mkdir -p ~/renovate-typo && cd ~/renovate-typo
cat > renovate.json <<'JSON'
{
  "extends": ["config:recommended"],
  "packageRules": [
    { "matchDepType": ["devDependencies"], "groupName": "dev dependencies" }
  ]
}
JSON
if npx --yes --package renovate@45.0.2 -- renovate-config-validator; then
  echo "expected the validator to fail"; false
else
  echo "the validator caught the typo"
fi
cd ~/renovate-demo
rm -rf ~/renovate-typo

The validator prints an error that names the bad option, something like Invalid configuration option: packageRules[0].matchDepType, exits non-zero, and the script prints the validator caught the typo. Without the validator, Renovate would report this on its next run in the Dependency Dashboard, not before.

Step 4 · Schedule updates and wait for releases to settle

By default Renovate opens pull requests whenever it runs, at any hour. A schedule batches them into one window. Renovate schedules use UTC unless you set timezone, and the cron form is the one Renovate recommends. The minutes field must be *, because Renovate works to the hour, not the minute.

minimumReleaseAge makes Renovate wait until a version has been public for a set time before it offers it. A release that is pulled or patched in its first day or two, or a hijacked package that is spotted and removed, never reaches you.

Add both at the top level of the file:

Bash
cat > renovate.json <<'JSON'
{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": ["config:recommended"],
  "timezone": "Africa/Lagos",
  "schedule": ["* 6-11 * * 1"],
  "minimumReleaseAge": "3 days",
  "packageRules": [
    {
      "description": "One pull request for minor and patch updates of dev tools",
      "matchDepTypes": ["devDependencies"],
      "matchUpdateTypes": ["minor", "patch"],
      "groupName": "dev dependencies"
    },
    {
      "description": "Merge patch updates once checks pass",
      "matchUpdateTypes": ["patch"],
      "automerge": true
    }
  ]
}
JSON
npx --yes --package renovate@45.0.2 -- renovate-config-validator --strict

* 6-11 * * 1 reads: any minute, hours 06 to 11, any day of the month, any month, Monday. Use any name from the IANA time zone list, such as Africa/Nairobi or Europe/London, for your own team. Keep the window several hours wide. The hosted app decides how often it visits your repository, so a one-hour window can be missed.

While a release is younger than three days, Renovate either holds the update back or, if the branch already exists, marks it with a pending status check that turns green once the time has passed.

Check it worked

With --strict, the validator also fails if any option needs migrating to a newer form, so a pass here means the file uses current syntax. It reports success and exits with code 0.

Step 5 · Pin GitHub Actions to commit digests

actions/checkout@v7 points at a tag, and a tag can be moved to different code. Pinning to the full commit SHA means the workflow runs exactly the code you reviewed. The helpers:pinGitHubActionDigests preset makes Renovate do the pinning and keep the pins current. Add it to extends:

Bash
cat > renovate.json <<'JSON'
{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": ["config:recommended", "helpers:pinGitHubActionDigests"],
  "timezone": "Africa/Lagos",
  "schedule": ["* 6-11 * * 1"],
  "minimumReleaseAge": "3 days",
  "packageRules": [
    {
      "description": "One pull request for minor and patch updates of dev tools",
      "matchDepTypes": ["devDependencies"],
      "matchUpdateTypes": ["minor", "patch"],
      "groupName": "dev dependencies"
    },
    {
      "description": "Merge patch updates once checks pass",
      "matchUpdateTypes": ["patch"],
      "automerge": true
    }
  ]
}
JSON
npx --yes --package renovate@45.0.2 -- renovate-config-validator --strict

On its first run Renovate opens a pull request that rewrites each uses: line to something like actions/checkout@<40-character SHA> # v7. The comment keeps the version readable. When v7 moves on, Renovate updates the SHA and the comment together. For the other hardening steps a workflow needs, see /tutorials/harden-github-actions-workflows.

Check it worked

The validator passes. Look at the file once more, since this is the version you will commit:

Bash
grep -c '"description"' renovate.json
grep 'pinGitHubActionDigests' renovate.json

The first command prints 2, one per package rule, and the second prints the extends line with both presets.

Step 6 · Preview the pull requests with a local dry run

Renovate has an experimental local platform that runs against the folder you are in, looks up every dependency and stops before creating anything. It is the quickest way to see what your rules will produce. It only reads files that git tracks, so stage the project first. The debug log is long, so send it to a file (.gitignore keeps it out of git):

Bash
git add .
LOG_LEVEL=debug npx --yes --package renovate@45.0.2 -- renovate --platform=local > dry-run.log 2>&1
grep -o '"branchName": "[^"]*"' dry-run.log | sort -u

You see one line per branch Renovate would open, something like:

Text
"branchName": "renovate/dev-dependencies"
"branchName": "renovate/express-5.x"
"branchName": "renovate/major-eslint-monorepo"

Read it against your rules. ESLint and Prettier minor updates share renovate/dev-dependencies. Express, a runtime dependency, gets its own branch. The jump to ESLint's next major sits alone, named after the ESLint monorepo group from config:recommended. The exact list depends on what has been released by the day you run it.

The log also contains a warning, something like GitHub token is required for some dependencies, naming the actions. Looking up action tags needs a GitHub token, which the hosted app has and your laptop run does not, so the digest pins do not show up here. The dry run also ignores the schedule. It shows what Renovate would do, not when.

Check it worked

Bash
grep 'Dependency extraction complete' -A 8 dry-run.log

The summary gives a dependency count per manager: three for npm, and four for github-actions. Renovate 45.0.2 counts the two actions, the node-version: 26 from the setup-node step and the ubuntu-latest runner (which it skips, because latest is not a version it can update). Everything in the project was found.

Step 7 · Turn Renovate on for the repository

Commit the project and push it to a GitHub repository you own (replace YOUR-USER/YOUR-REPO):

Bash
git add .
git commit -m "Add Renovate config"
git log --oneline -n 1
Bash
git remote add origin git@github.com:YOUR-USER/YOUR-REPO.git
git push -u origin main

Install the Renovate app from github.com/apps/renovate. On the install page choose "Only select repositories" and pick this one. Because renovate.json is already on the default branch, Renovate skips its usual "Configure Renovate" onboarding pull request and starts work with your settings. On a repository without a config file it opens that onboarding pull request first and changes nothing until you merge it.

If you cannot use the hosted app (a private Git server, or a policy against third-party apps), Renovate also runs self-hosted, for example from a scheduled workflow or a cron job with a token you control. The same renovate.json works there. The self-hosting guide at docs.renovatebot.com covers the global settings it needs.

Now make automerge safe. Renovate uses GitHub's own auto-merge by default, and GitHub merges as soon as the pull request meets the branch's rules. Without a rule, that can mean before your tests have finished. First turn the feature on: in the repository go to Settings, General, scroll to Pull Requests and tick "Allow auto-merge". If it stays off, Renovate falls back to merging the pull request itself after its checks pass. Then, in the repository settings, add a branch protection rule or ruleset for main that requires the test status check to pass before merging.

Check it worked

Within a few hours of installing, the repository has a new issue called "Dependency Dashboard". Unless it is Monday morning in Lagos, it lists the action digest pin (something like "Pin dependencies") and the other updates as awaiting their schedule, with no pull requests open yet. The pin pull request opens in the next Monday window, or on Renovate's next run if you tick its checkbox on the dashboard.

Step 8 · Read the Dependency Dashboard

Open the "Dependency Dashboard" issue. Renovate rewrites it on every run, so it is always the current state of every update. The sections you will use most:

  • Updates waiting for their schedule, each with a checkbox. Tick one to have Renovate open that pull request on its next run instead of waiting for Monday. Use it for a security fix you need today.
  • Updates waiting for status checks, including releases still inside the three-day minimumReleaseAge.
  • Open pull requests, with a checkbox to rebase or retry each one.
  • Ignored or blocked updates: if you close a Renovate pull request without merging, the update moves here and Renovate will not offer that version again unless you tick it.
  • Detected dependencies, a collapsible list of every package file and dependency Renovate found. Compare it with what you expect. A missing file usually means Renovate does not recognise its format or the file sits in an ignored folder.

Warnings about your config also appear at the top of the issue. Fix them on main, and run the validator locally first.

On Monday morning the pull requests from your dry run appear, plus the digest pin: something like renovate/pin-dependencies, renovate/dev-dependencies, renovate/express-5.x and renovate/major-eslint-monorepo, unless you already opened the pin one from the dashboard. They arrive over the morning rather than all at once, because Renovate creates at most two pull requests an hour by default (prHourlyLimit). Read the release notes Renovate puts in each pull request body before you merge anything that is not a patch. Renovate automerges at most one branch per run, so a batch of patch updates can take several runs to clear.

Check it worked

The dashboard's detected dependencies list package.json with express, eslint and prettier, and .github/workflows/test.yml with the two actions, the Node.js version from setup-node and the runner. Each pull request that Renovate opened is linked from the dashboard, and after a patch pull request merges itself it disappears from the open list.

When you are finished with the demo, uninstall the app from the repository (GitHub settings, Applications), delete the GitHub repository if you made one only for this, and remove the local folder and the debug log:

Bash
cd ~
rm -rf ~/renovate-demo

Next steps

  • Compare Renovate with GitHub's built-in updater, and turn on security alerts: /tutorials/configure-dependabot-version-and-security-updates.
  • Harden the workflows whose actions you just pinned: /tutorials/harden-github-actions-workflows.
  • Make sure there are tests for automerge to wait on: /tutorials/run-node-tests-in-github-actions.

Need this done for you?

Padding does this work for growing companies, from the first diagnosis to a system that keeps working.

Platform Engineering

Get new tutorials

New tutorials, about twice a month.