Update application dependencies with Renovate
This guide shows how to let Renovate open pull requests for the dependencies of your application, such as libraries, Docker images, and GitHub Actions.
The renovate.json5 from the CI/CD guides limits Renovate to Golden Path templates and GitHub Actions. This guide removes that limit. If the repository also has Terraform code, Renovate then also updates the Terraform providers and modules.
Step 1: Install the Renovate GitHub App on your repository
If you're an administrator of the repository, add it to the kjoremiljo-renovate GitHub App.
If you lack the permissions, ask Team Utviklerflyt in the #utviklerflyt-support Slack channel. You can copy this message:
Step 2: Add the configuration
Set up Renovate to open pull requests for all the dependencies of this application. Follow `{page}`, starting from Step 2. Step 1 is done.
Create renovate.json5 in the root of the repository, or change the one you have:
{
$schema: "https://docs.renovatebot.com/renovate-schema.json",
extends: [
"github>oslokommune/golden-path-renovate:default.json5", // (1)!
"github>oslokommune/golden-path-renovate:golden-path-v2.json5", // (2)!
],
}
- The shared settings. Renovate updates every dependency it finds, on weekdays, and waits 7 days after a third-party release. It keeps at most 10 pull requests open.
- The rules for Golden Path templates. If your file has
only-golden-path-v2.json5here, replace it with this line. Theonly-preset turns off every update except Golden Path templates and GitHub Actions.
Expect up to 10 pull requests at a time
Renovate opens a pull request for each dependency that has a newer version. When you merge or close one, it opens the next. To choose which ones it opens first, use the Dependency Dashboard issue.
Step 3: Stop Dependabot from opening the same updates (optional)
Skip this step if the repository has no .github/dependabot.yml.
Dependabot and Renovate both open a pull request for the same update when they cover the same dependencies. To prevent that, remove those ecosystems from .github/dependabot.yml.
Step 4: Verify
- Open the Renovate workflow.
- Select Run workflow, enter the name of your repository, and start the run. You can also wait for the next hourly run.
- Check your repository when the run finishes. The
Dependency Dashboardissue lists the dependencies that Renovate found, and new pull requests come from branches that start withok-renovate/.
If the run has no job for your repository, the app isn't installed on it. Go back to step 1.
Next steps
To let Renovate merge some of these updates on its own, see Automatically merge dependency updates with Renovate.