plugin-git icon indicating copy to clipboard operation
plugin-git copied to clipboard

[Feature] Support `submodule_override` for nested submodules

Open amrsoll opened this issue 2 years ago • 0 comments

Would be suuper cool to support nested submodule path overrides

clone:
  git:
    image: woodpeckerci/plugin-git
    settings:
      recursive: true
      submodule_override:
        first_submodule_path: <url for first_submodule_path>
        # The following does not apply when git recurses into first_submodule_path
        first_submodule_path/other_dir/nested_submodule: <url for nested_submodule>

I am trying to override the github url of my submodules to a local git server

Example output:

+ git submodule update --init --recursive
Cloning into '/woodpecker/src/{woodpecker_url}/{main_repo_path}'...
Submodule path '{first_submodule}': checked out 'f5a8687e04965c597e534f9afe2935aedd1a4753' 
Cloning into '/woodpecker/src/{woodpecker_url}/{main_repo_path}/other_dir/nested_submodule'...
fatal: could not read Username for 'https://github.com': No such device or address
fatal: clone of '{{nested_module_url}}' into submodule path '/woodpecker/src/{woodpecker_url}/{main_repo_path}/other_dir/nested_submodule' failed
Failed to clone 'other_dir/nested_submodule'. Retry scheduled 
Cloning into '/woodpecker/src/{woodpecker_url}/{main_repo_path}/other_dir/nested_submodule'...
fatal: could not read Username for 'https://github.com': No such device or address
fatal: clone of '{{nested_module_url}}' into submodule path '/woodpecker/src/{woodpecker_url}/{main_repo_path}/other_dir/nested_submodule' failed
Failed to clone 'other_dir/nested_submodule' a second time, aborting
fatal: Failed to recurse into submodule path '{first_submodule}'
exit status 1 

amrsoll avatar Mar 14 '23 13:03 amrsoll