Can't clone private submodules in C++ Scan

I am running a SonarCloud Scan on a C++ private GitHub repo which contains private submodules from the same organization

My workflow file /.github/workflows/build.yml is:

    name: Build
    runs-on: ubuntu-20.04
      BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
      - name: Checkout repository
        uses: actions/checkout@v2
      - name: Checkout submodules
        run: git submodule update --init --recursive

My submodules file .gitmodules:

[submodule "external/project1"]
    path = external/project1
    url =

When running the workflow, I get the following error:

Cloning into '/home/runner/work/repo/external/project1'...
fatal: could not read Username for '': No such device or address
fatal: clone of '' into submodule path '/home/runner/work/repo/external/project1' failed
Failed to clone 'external/project1'. Retry scheduled

I tried out different configurations form Checkout submodules · Actions · GitHub Marketplace · GitHub but I still have the error.

Any help? Thanks.

Hey there.

This seems like a problem that would exist whether you were adding SonarCloud analysis to your repository or not (let me know if I’m missing some detail that would mean otherwise). Therefore, we probably aren’t the best community to help with this error message. Maybe the GitHub Actions community can help you.

Thanks, exactly, I’ll checkit

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.