Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submodule initialization with private sumodule fails #268

Open
leoheck opened this issue Jun 1, 2020 · 7 comments
Open

Submodule initialization with private sumodule fails #268

leoheck opened this issue Jun 1, 2020 · 7 comments

Comments

@leoheck
Copy link

leoheck commented Jun 1, 2020

Hi, I am testing v2. My goal is to initialize submodules behind a private repo with the whole history.

I am not sure if I am doing this right, but I am doing this.

    - uses: actions/checkout@v2
      with:
        token: ${{ secrets.CI_PAT }}
        submodules: 'true'
        fetch-depth: 0

And receiving this output.

Run actions/checkout@v2
/usr/bin/docker exec  cf6073467e49ed136c89b40c65140167d4da6b133a966b11d7b7277f30c084cb sh -c "cat /etc/*release | grep ^ID"
Syncing repository: my_company/my_repo
Getting Git version info
Deleting the contents of '/__w/my_repo/my_repo'
Initializing the repository
Disabling automatic garbage collection
Setting up auth
Fetching the repository
  /usr/bin/git -c protocol.version=2 fetch --prune --progress --no-recurse-submodules origin +refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/* +eebee8254a6b64f5edb7510c9a2fbdebe78873bb:refs/remotes/pull/156/merge
  remote: Repository not found.
  ##[error]fatal: repository 'https://github.com/my_company/my_repo/' not found
  The process '/usr/bin/git' failed with exit code 128
  Waiting 20 seconds before trying again
  /usr/bin/git -c protocol.version=2 fetch --prune --progress --no-recurse-submodules origin +refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/* +eebee8254a6b64f5edb7510c9a2fbdebe78873bb:refs/remotes/pull/156/merge
  remote: Repository not found.
  ##[error]fatal: repository 'https://github.com/my_company/my_repo/' not found
  The process '/usr/bin/git' failed with exit code 128
  Waiting 11 seconds before trying again

The repo and the company name was renamed here, but they are good
The browser opens the (right) URL.

@leoheck
Copy link
Author

leoheck commented Jun 1, 2020

Testing this on my computer, same output

➜ /usr/bin/git -c protocol.version=2 fetch --prune --progress --no-recurse-submodules origin +refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/* +20816e26ca5ed9fb1e1da7ea96b2ae70d18824ad:refs/remotes/pull/156/merge      

Them removing this ...

+refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/* 

With this command, I was able to execute it with success

➜ /usr/bin/git -c protocol.version=2 fetch --prune --progress --no-recurse-submodules origin +20816e26ca5ed9fb1e1da7ea96b2ae70d18824ad:refs/remotes/pull/156/merge      

So, does this is something I am doing wrong? If not, how to work around it while I can't see any fix?

@leoheck
Copy link
Author

leoheck commented Jun 1, 2020

Same issue here, #254 but it was closed.

@ahmadnassri
Copy link

ahmadnassri commented Jun 8, 2020

same issue here, tried the following from other similar issues:

  • https vs. git urls
  • using a PAT, confirmed has access to repo
Log
Fetching the repository
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +2471ca0a3f4e0ae04bb566a9e0aba7bd9def5847:refs/remotes/pull/7/merge
  ##[error]fatal: could not read Username for 'https://github.com': terminal prompts disabled
  The process '/usr/bin/git' failed with exit code 128
  Waiting 11 seconds before trying again
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +2471ca0a3f4e0ae04bb566a9e0aba7bd9def5847:refs/remotes/pull/7/merge
  ##[error]fatal: could not read Username for 'https://github.com': terminal prompts disabled
  The process '/usr/bin/git' failed with exit code 128
  Waiting 12 seconds before trying again
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +2471ca0a3f4e0ae04bb566a9e0aba7bd9def5847:refs/remotes/pull/7/merge
  ##[error]fatal: could not read Username for 'https://github.com': terminal prompts disabled
  ##[error]The process '/usr/bin/git' failed with exit code 128

@ahmadnassri
Copy link

ahmadnassri commented Jun 8, 2020

according to the docs for submodules flag:

# When the `ssh-key` input is not provided, SSH URLs beginning with
# `git@github.com:` are converted to HTTPS.

so i'm gonna attempt that next, however, adding an SSH key for this seems overkill

@leoheck
Copy link
Author

leoheck commented Jun 9, 2020

Someone told that V2 does not implement submodule but this info is not on README. So it will be nice to put it there if it is right.

@davivcgarcia
Copy link

Is works for me with:

    steps:
    - name: Git Checkout
      uses: actions/checkout@v2
      with:
        submodules: true

@leoheck
Copy link
Author

leoheck commented Jul 10, 2020

Yeap, I tested this yesterday as well and it is working now. My issue is that my submodule is private.

But this is working as well now.

    - name: Checkout with submodules
      uses: actions/checkout@v2
      with:
        submodules: 'true'
        token: ${{secrets.CI_PAT}}

@leoheck leoheck changed the title Submodule initialization fails Submodule initialization with private sumodule fails Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants