0

I want to clone a project hosted on an enterprise Gitlab from GitHub workflow.

steps:   

- run: |
    
    git clone https://gitlab.xyz.net/Group/project.git

Running above gives me error

Cloning into 'project'...
fatal: could not read Username for 'https://gitlab.xyz.net': No such device or address
Error: Process completed with exit code 128.
Sayed Naweed
  • 171
  • 1
  • 4
  • 1
    Is the gitlab repo public or private? (if private, I suggest looking for this [question](https://stackoverflow.com/questions/30202642/how-can-i-clone-a-private-gitlab-repository)) – GuiFalourd Aug 04 '21 at 23:35

1 Answers1

1

A private GitLab server does not have public repositories by all chances, so you probably need to authenticate for example like this:

- name: Clone private repo
  run: git clone "https://username:$EXTERNAL_TOKEN@github.company.com/my-org/my-repo" main
  env:
    EXTERNAL_TOKEN : ${{ secrets.EXTERNAL_TOKEN }}
timmeinerzhagen
  • 412
  • 4
  • 7