Skip to content

Validate renovate.json in CI - #554

Open
tonygermano wants to merge 1 commit into
OpenIntegrationEngine:mainfrom
tonygermano:ci/validate-renovate-config
Open

tonygermano wants to merge 1 commit into
OpenIntegrationEngine:mainfrom
tonygermano:ci/validate-renovate-config

Conversation

@tonygermano

Copy link
Copy Markdown
Member

Summary

This PR adds a workflow, .github/workflows/renovate-config.yaml, that checks renovate.json with Renovate's own renovate-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.

  • When it runs: on pull requests to main, and pushes to main, that change renovate.json or the workflow file. Other PRs don't run it. The workflow has contents: read permission only.
  • How it runs: the validator comes from the official ghcr.io/renovatebot/renovate image, pinned by tag and digest. It's referenced as a docker:// step rather than a docker run command, so Renovate's github-actions manager keeps the image current alongside the other pinned actions. actions/checkout uses the same pinned commit as build.yaml.
  • Flags: --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-global

Renovate 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 example allowedCommands, 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-global is passed. In that mode, global-only options pass validation even though a repository config isn't allowed to set them. --no-global validates the file as a repository config, which rejects those options. Claude confirmed this with a copy of our renovate.json with allowedCommands added: 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."

--strict makes 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:

actionlint reports 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

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>
@mgaffigan

mgaffigan commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

You might limit the check out to the target commit. I don't think that happens by default IIRC

Edit: it's the default. Never mind.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Test Results

133 files  ±0  133 suites  ±0   4m 8s ⏱️ + 1m 15s
817 tests ±0  817 ✅ ±0  0 💤 ±0  0 ❌ ±0 
943 runs  ±0  937 ✅ ±0  6 💤 ±0  0 ❌ ±0 

Results for commit 390e4d3. ± Comparison against base commit 3c79615.

@tonygermano

Copy link
Copy Markdown
Member Author

You might limit the check out to the target commit. I don't think that happens by default IIRC

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants