checkout icon indicating copy to clipboard operation
checkout copied to clipboard

terminal prompts disabled when submodules: true

Open piuy11 opened this issue 2 years ago • 6 comments

Having issue with submodules. I have a private repo which has other private repos as submodules. Tried with the workflow below, but keeps showing following error message for all my submodules:

/usr/bin/git -c protocol.version=2 submodule update --init --force --depth=1 --recursive
Cloning into '<MY_SUBMODULE_REPO>'...
Error: fatal: could not read Username for 'https://github.com/': terminal prompts disabled

However, since removing line with submodules from workflow worked (without cloning submodules), I assume that auth process is broken.

My workflow:

name: Testing
on:
  push:
    branches: [ test-action ]
jobs:
  steps:
    runs-on: self-hosted
    steps:        
      - uses: actions/checkout@v2
        with:
          submodules: true
          ssh-key: ${{ secrets.SSH_KEY }}

What I tried:

  • Checked secrets
  • Tried with token instead of ssh-key (including checking scopes of PAT)
  • Change self-hosted to ubuntu-latest

All didn't work.

piuy11 avatar Mar 23 '22 07:03 piuy11

Solved by solution from here, but submodules: true still not working..

piuy11 avatar Mar 24 '22 05:03 piuy11

This is a new issue for us all our builds were working up to yesterday or so and started to fail today.

bjonnh-work avatar Mar 30 '22 15:03 bjonnh-work

I experienced this issue as well, cloning private submodules where the URL is specified as SSH. Turns out my PAT was expired, refreshing it seems to have solved it for me.

twizmwazin avatar Apr 01 '22 18:04 twizmwazin

This was not the case for us it was not expired, we switched to SSH keys for everything and the issue is gone.

bjonnh-work avatar Apr 01 '22 19:04 bjonnh-work

در تاریخ چهارشنبه ۲۳ مارس ۲۰۲۲،‏ ۱۲:۲۲ piuy11 @.***> نوشت:

Having issue with submodules. I have a private repo which has other private repos as submodules. Tried with the workflow below, but keeps showing following error message for all my submodules:

/usr/bin/git -c protocol.version=2 submodule update --init --force --depth=1 --recursive Cloning into '<MY_SUBMODULE_REPO>'... Error: fatal: could not read Username for 'https://github.com/': terminal prompts disabled

However, since removing line with submodules from workflow worked (without cloning submodules), I assume that auth process is broken.

My workflow:

name: Testing on: push: branches: [ test-action ] jobs: steps: runs-on: self-hosted steps: - uses: @.*** with: submodules: true ssh-key: ${{ secrets.SSH_KEY }}

What I tried:

  • Checked secrets
  • Tried with token instead of ssh-key (including checking scopes of PAT)
  • Change self-hosted to ubuntu-latest

All didn't work.

— Reply to this email directly, view it on GitHub https://github.com/actions/checkout/issues/738, or unsubscribe https://github.com/notifications/unsubscribe-auth/AW3KO645RWIPOLMQFCCFBFDVBLEUFANCNFSM5RNFLQOQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

milad77pnq avatar Apr 02 '22 10:04 milad77pnq

In our organization this error was caused by the fact that the Personal Access Token (PAT) had expired.

To be able to checkout the submodule, a PAT is required - this is passed in the workflow as an environment value that is retrieved from the repo "secrets":

- name: Checkout Git repository
        uses: actions/checkout@v2
        with:
          token: ${{ secrets.PAT }}
          path: ${{ env.plugin_slug }}
          submodules: true

The annoying thing is that the PAT needs to be linked to a specific account (so not the Github organization). So I discover that my "personal" PAT was outdated.

Solution was simple:

  1. Regenerated my personal token here.
  2. Copy to the organization secrets:

Captura de ecrã de 2022-09-21 12-53-46

  1. Click the update button below and insert the update personal token:

Captura de ecrã de 2022-09-21 12-53-55

Done!

alexmigf avatar Sep 21 '22 11:09 alexmigf

In my case I've remove option "Restrict who can push to specific branch" option from repo settings

followthemoney1 avatar Mar 03 '23 20:03 followthemoney1