Repository navigation
Validate renovate.json in CI - #554
Open
tonygermano wants to merge 1 commit into
Open
tonygermano wants to merge 1 commit into
tonygermano wants to merge 1 commit into
Conversation
Add a workflow that runs renovate-config-validator from the official Renovate image on pushes and pull requests to main that change renovate.json or the workflow itself. Otherwise a mistake in the config only shows up the next time Renovate runs on the repository. The image is referenced as a docker:// step, pinned by tag and digest, so Renovate's github-actions manager keeps it current like the other pinned actions. The validator runs with --strict --no-global. Without --no-global, a file named on the command line is validated as global self-hosted configuration, which accepts options a repository config may not set: a renovate.json containing allowedCommands passes without the flag and fails with it. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Tony Germano <tony@germano.name>
tonygermano
requested review from
a team,
NicoPiel,
gibson9583,
jonbartels,
kayyagari,
kpalang,
mgaffigan and
ssrowe
November 1, 2026 18:30
mgaffigan
approved these changes
Nov 1, 2026
Contributor
|
Edit: it's the default. Never mind. |
Member
Author
I checked and our normal build workflow works the same way. The readme for the action says that only a single commit is checked out by default (fetch-depth=1). Good thought, though. It was still worth a look. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a workflow,
.github/workflows/renovate-config.yaml, that checksrenovate.jsonwith Renovate's ownrenovate-config-validator. Today a mistake in the config only shows up the next time Renovate runs on the repository, when it stops opening PRs or reports a config error. With this workflow, the PR that introduces the mistake gets a failing check.main, and pushes tomain, that changerenovate.jsonor the workflow file. Other PRs don't run it. The workflow hascontents: readpermission only.ghcr.io/renovatebot/renovateimage, pinned by tag and digest. It's referenced as adocker://step rather than adocker runcommand, so Renovate'sgithub-actionsmanager keeps the image current alongside the other pinned actions.actions/checkoutuses the same pinned commit asbuild.yaml.--strict --no-global renovate.json.The check isn't meant to be required for merging. Like the main build, it relies on reviewers seeing the red X.
Why
--no-globalRenovate has two kinds of configuration. A repository config (our
renovate.json) is read from the repository being updated. A global config is set by whoever runs a self-hosted Renovate instance. Some options are only allowed in global config, for exampleallowedCommands, which controls which shell commands Renovate may run after an upgrade.When the validator is given file names, it treats them as global config unless
--no-globalis passed. In that mode, global-only options pass validation even though a repository config isn't allowed to set them.--no-globalvalidates the file as a repository config, which rejects those options. Claude confirmed this with a copy of ourrenovate.jsonwithallowedCommandsadded: it passes without the flag, and with the flag it fails with "The "allowedCommands" option is a global option reserved only for Renovate's global configuration and cannot be configured within a repository's config file."--strictmakes the job fail on warnings and on options that need migration, not only on errors.The workflow file has a comment explaining both flags.
Trade-off
Renovate publishes releases very often, so the pinned image will get an update PR every month under our monthly schedule, and new major versions need approval on the dependency dashboard.
Testing
Claude checked, running the validator from the pinned image with the same arguments as the workflow and the repository mounted read-only:
renovate.jsononmainvalidates as repo config, and so does the one in Keep Guava on -jre and drop redundant Renovate groups #553.renovate.jsonwith a misspelled option (groupNam) fails with exit code 1 and names the option.allowedCommandscase above.actionlintreports no problems in the workflow.Not tested: the workflow itself on GitHub. It will run on this PR, since the PR changes the workflow file.
🤖 Drafted with Claude Code