0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 13:38:32 +00:00
renovatebot_renovate/lib/modules/manager/git-submodules
Risu 397ab49ef3
docs(managers): add missing url and displayName (#32621)
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
2024-12-01 08:47:27 +00:00
..
__fixtures__ feat(managers/git-submodules): support updating git-tag versions (#30104) 2024-07-26 07:03:59 +00:00
artifact.spec.ts refactor(prettier): Force trailing commas (#25631) 2023-11-07 15:50:29 +00:00
artifacts.ts chore: update types reference 2023-08-15 11:31:15 +02:00
extract.spec.ts chore: eslint to enforce for typed imports (#30844) 2024-08-19 13:15:27 +00:00
extract.ts fix(manager/git-submodules): get recorded submodule commit (#30976) 2024-08-23 03:39:56 +00:00
index.ts docs(managers): add missing url and displayName (#32621) 2024-12-01 08:47:27 +00:00
readme.md docs(git-submodules): clarify tags/branches (#31515) 2024-09-21 07:41:25 +00:00
types.ts refactor: lib/modules (#14488) 2022-03-04 09:04:02 +01:00
update.spec.ts chore: eslint to enforce for typed imports (#30844) 2024-08-19 13:15:27 +00:00
update.ts fix(manager/git-submodule): updates when update=none (#32455) 2024-11-28 17:43:03 +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.)