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:

jobs:
  build:
    name: Build
    runs-on: ubuntu-20.04
    env:
      SONAR_SCANNER_VERSION: 4.6.1.2450 #4.4.0.2170
      SONAR_SERVER_URL: "https://sonarcloud.io"
      BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
    steps:
      - 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 = https://github.com/organization/project1

When running the workflow, I get the following error:

Cloning into '/home/runner/work/repo/external/project1'...
fatal: could not read Username for 'https://github.com': No such device or address
fatal: clone of 'https://github.com/organization/project1' 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.