Files
renovate/lib/modules/manager/git-submodules
Michael Kriese 312c380926 test(manager): cover the pre-commit warning switch and drop unreachable fallbacks (#46221)
* fix(util/http): make the legacy `headers` getter configurable

Every other property defined on `HttpError.prototype` in this file is
`configurable`, but `headers` was not. That makes the module fail with
`TypeError: Cannot redefine property: headers` whenever a test resets the
module registry and re-imports anything that pulls in `got.ts`.

Co-authored-by: Claude Opus 5 <michael.kriese+claude-code@mend.io>

* test(manager/pre-commit): cover the suppress-warning env var

`defaultConfig.prBodyNotes` drops the unsupported-manager warning when
`RENOVATE_X_SUPPRESS_PRE_COMMIT_WARNING` is set. Since the value is
computed at module load, the new spec resets the module registry and
re-imports the manager with the variable stubbed.

The `istanbul ignore next` on that arm is dropped because the branch is
now exercised.

Co-authored-by: Claude Opus 5 <michael.kriese+claude-code@mend.io>

* refactor(manager): remove unreachable fallbacks

Drop three defensive fallbacks that can never be taken:

- `docker-compose`: `config.services ?? config` always yields an object,
  so the `|| {}` guard behind it is dead
- `git-submodules`: `git.raw()` resolves to a string, so the `?? ''`
  never applies
- `maven`: the only site that builds a `MavenProp` always passes a
  `packageFile` string, so narrow the type and drop the `?? undefined`

Co-authored-by: Claude Opus 5 <michael.kriese+claude-code@mend.io>

---------

Co-authored-by: Claude Opus 5 <michael.kriese+claude-code@mend.io>
2026-09-16 06:43:02 +00:00
..

Keeps Git submodules updated within a repository.

You can customize the per-submodule checks of the git-submodules manager like this:

{
  "ignoreDeps": ["path/to/submodule", "path/to/submodule2"],
  "git-submodules": {
    "enabled": true
  }
}

Updating to Specific Tag Values

If you want to update your Git submodules to a specific tag, you can set the desired tag as the branch in your .gitmodules file. Renovate will then automatically update this version to the latest Git branch or tag which satisfies your versioning scheme.

[submodule "renovate"]
  path = deps/renovate
  url = https://github.com/renovatebot/renovate.git
  branch = v0.0.1

Note: Using this approach will disrupt the native git submodule update experience when using git submodule update --remote. You may encounter an error like fatal: Unable to find refs/remotes/origin/v0.0.1 revision in submodule path... because Git can only update submodules when tracking a branch. To manually update the submodule, navigate to the submodule directory and run the following commands: git fetch && git checkout <new tag>.

Private Modules Authentication

Before running the git commands to update the submodules, Renovate exports git insteadOf directives in environment variables.

The following logic is executed prior to "submodules" updating:

The token from the hostRules entry matching hostType=github and matchHost=api.github.com is added as the default authentication for github.com. For those running against github.com, this token will be the default platform token.

Next, all hostRules with both a token or username/password and matchHost will be fetched, except for any github.com one from above.

Rules from this list are converted to environment variable directives if they match any of the following characteristics:

  • No hostType is defined, or
  • hostType is git-tags or git-refs, or
  • hostType is a platform (github, gitlab, azure, etc.)