1

I have a github action CI configured to use pipenv to install a package from a private repository. For reasons unknown, pipenv install command returns the following error:

FAIL
ERROR:pip.subprocessor:Command errored out with exit status 128:
 command: git clone -q 'https://****@github.com/<ORG>/<REPO>.git' /tmp/pipenv-_xaxkgk4-src/csci-utils
     cwd: None
Complete output (1 lines):
fatal: could not read Password for 'https://${SUPER_SECRET}@github.com': No such device or address

I'm expecting the pipenv file to read the variable from an .env file created during CI run. Following is the relevant github workflow config, which runs before pipenv executes:

- name: Create .env file
        run: |
          touch .env
          echo ${{ secrets.PERSONAL_ACCESS_TOKEN }}
          echo SUPER_SECRET=${{ secrets.PERSONAL_ACCESS_TOKEN }} > .env
          cat .env

PS: Personal access token is the secret's name created under the current repository of the user. This is not the default Github-token.

Update: Am able to confirm that pipenv receives the correct secret, by modifying and print the secret to the log. So, this essentially changes the question to - why does git clone ask for password even when password-token is used ?

fixxxer
  • 15,568
  • 15
  • 58
  • 76
  • 1
    Regarding your question, not sure, but this was asked for Oauth about the password request. It might be a scope issue: https://stackoverflow.com/questions/42148841/github-clone-with-oauth-access-token – astrochun Mar 28 '21 at 18:09
  • @astrochun thanks for the link; I did see it before and i'm currently using a personal access token - hence, this is more puzzling that this issue still occurs, because PATs have the broadest scope there is, afaik. – fixxxer Mar 28 '21 at 18:13
  • 1
    Another option, for private repo, is to store your private SSH key and pass that. That would avoid the password request. Though I prefer PATs for CI. – astrochun Mar 28 '21 at 18:15
  • 1
    @astrochun keeping that as the last alternative. have just sunk too much time on PATs already; really want to figure out what went wrong. – fixxxer Mar 28 '21 at 18:24

0 Answers0