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

Checkout with PAT does not work #2033

Closed
RobertDeRose opened this issue Jan 7, 2025 · 1 comment
Closed

Checkout with PAT does not work #2033

RobertDeRose opened this issue Jan 7, 2025 · 1 comment

Comments

@RobertDeRose
Copy link

Then using a PAT, that I have confirmed works locally and in other actions, checkout fails to be able to checkout either the workflow's repo or remote repos (private).

This doesn't work

  - name: Checkout Code
      uses: actions/checkout@v4
      with:
        token: ${{ secrets.ORG_GIT_TOKEN }}
actions/checkout@v4
  with:
    token: ***
    repository: <our-org>/<our-repo>
    ssh-strict: true
    ssh-user: git
    persist-credentials: true
    clean: true
    sparse-checkout-cone-mode: true
    fetch-depth: 1
    fetch-tags: false
    show-progress: true
    lfs: false
    submodules: false
    set-safe-directory: true
Syncing repository: <our-org>/<our-repo>
Getting Git version info
Temporarily overriding HOME='/home/runner/work/_temp/1cc82281-8c54-4632-b165-99d8270d4ae6' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
/usr/bin/git config --global --add safe.directory /home/runner/work/<our-repo>/<our-repo>
Deleting the contents of '/home/runner/work/<our-repo>/<our-repo>'
Initializing the repository
  /usr/bin/git init /home/runner/work/<our-repo>/<our-repo>
  hint: Using 'master' as the name for the initial branch. This default branch name
  hint: is subject to change. To configure the initial branch name to use in all
  hint: of your new repositories, which will suppress this warning, call:
  hint:
  hint: 	git config --global init.defaultBranch <name>
  hint:
  hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
  hint: 'development'. The just-created branch can be renamed via this command:
  hint:
  hint: 	git branch -m <name>
  Initialized empty Git repository in /home/runner/work/<our-repo>/<our-repo>/.git/
  /usr/bin/git remote add origin https://github.com/<our-org>/<our-repo>
Disabling automatic garbage collection
  /usr/bin/git config --local gc.auto 0
Setting up auth
  /usr/bin/git config --local --name-only --get-regexp core\.sshCommand
  /usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
  /usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
  /usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
  /usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***
Fetching the repository
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +09449099e25a268d521465205e31470193b5ca74:refs/remotes/pull/16/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 14 seconds before trying again
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +09449099e25a268d521465205e31470193b5ca74:refs/remotes/pull/16/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 --no-recurse-submodules --depth=1 origin +09449099e25a268d521465205e31470193b5ca74:refs/remotes/pull/16/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

Nor does this

   - name: Checkout Client
      uses: actions/checkout@v4
      with:
        repository: <our-org>/<our-other-repo>
        ref: python-sdk
        path: <our-other-repo>
        token: ${{ secrets.ORG_GIT_TOKEN }}
Run actions/checkout@v4
Syncing repository: <our-org>/<our-other-repo>
Getting Git version info
  Working directory is '/home/runner/work/<our-org>/<our-repo>/<our-other-repo>'
  /usr/bin/git version
  git version 2.47.1
Temporarily overriding HOME='/home/runner/work/_temp/9b9ea95e-6597-4ba7-9790-0e25b13f6f9d' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
/usr/bin/git config --global --add safe.directory /home/runner/work/<our-org>/<our-repo>/<our-other-repo>
Initializing the repository
  /usr/bin/git init /home/runner/work/<our-org>/<our-repo>/<our-other-repo>
  hint: Using 'master' as the name for the initial branch. This default branch name
  hint: is subject to change. To configure the initial branch name to use in all
  hint: of your new repositories, which will suppress this warning, call:
  hint:
  hint: 	git config --global init.defaultBranch <name>
  hint:
  hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
  hint: 'development'. The just-created branch can be renamed via this command:
  hint:
  hint: 	git branch -m <name>
  Initialized empty Git repository in /home/runner/work/<our-org>/<our-repo>/<our-other-repo>/.git/
  /usr/bin/git remote add origin https://github.com/<our-org>/<our-other-repo>
Disabling automatic garbage collection
  /usr/bin/git config --local gc.auto 0
Setting up auth
  /usr/bin/git config --local --name-only --get-regexp core\.sshCommand
  /usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
  /usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
  /usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
  /usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***
Fetching the repository
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +refs/heads/python-sdk*:refs/remotes/origin/python-sdk* +refs/tags/python-sdk*:refs/tags/python-sdk*
  Error: fatal: could not read Username for 'https://github.com': terminal prompts disabled
  The process '/usr/bin/git' failed with exit code 128
  Waiting 17 seconds before trying again
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +refs/heads/python-sdk*:refs/remotes/origin/python-sdk* +refs/tags/python-sdk*:refs/tags/python-sdk*
  Error: fatal: could not read Username for 'https://github.com': terminal prompts disabled
  The process '/usr/bin/git' failed with exit code 128
  Waiting 20 seconds before trying again
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +refs/heads/python-sdk*:refs/remotes/origin/python-sdk* +refs/tags/python-sdk*:refs/tags/python-sdk*
  Error: fatal: could not read Username for 'https://github.com': terminal prompts disabled
  Error: The process '/usr/bin/git' failed with exit code 128        
@vukasin-nikodijevic
Copy link

@RobertDeRose what was the cause for that behavior ?

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

2 participants