title: Checkout a private github in Azure pipeline job using service connection
body: <p>I want to checkout one of the private repo which is located in the same GitHub organization in one of the Azure pipeline stages, based on Azure documentation here is what I have tried:</p>
  
  <p><a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops</a></p>
  
  <pre><code>resources:
    repositories:
    - repository: pipelinetemplates
      type: github
      name: myorg/myrepotemplate
      endpoint: mygithub-serviceconnection
    - repository: myrepo
      type: github
      name: myorg/myrepo
      endpoint: mygithub-serviceconnection
  stages:
  - stage:
    jobs:
    - job: Build
      steps:
      - template: Template/build.yaml@pipelinetemplates ##It works fine
      pool:
         vmImage: 'ubuntu-latest'
  
  - stage:
    jobs:
     - job: A
       pool:
         vmImage: 'ubuntu-latest'
       steps:
       - checkout: myrepo  ##Error-not found repo
       - task: PowerShell@2
         inputs:
          targetType: 'inline'
          script: |
            Write-Host "Fetching files"
            ls
  </code></pre>
  
  <p>I get this error message in checkout part:</p>
  
  <pre><code>Syncing repository: myorg/myrepo (github)
  git version
  git version 2.24.0
  git lfs version
  git-lfs/2.9.1 (GitHub; linux amd64; go 1.13.1)
  git init "/home/vsts/work/1/s"
  Initialized empty Git repository in /home/vsts/work/1/s/.git/
  git remote add origin https://github.com/myorg/myrepo
  git config gc.auto 0
  git config --get-all http.https://github.com/myorg/myrepo.extraheader
  git config --get-all http.proxy
  git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules origin
  remote: Repository not found.
  fatal: repository 'https://github.com/myorg/myrepo/' not found
  ##[warning]Git fetch failed with exit code 128, back off 5.284 seconds before retry.
  </code></pre>
  
  <p>Does anyone know what the problem is and how it can be fixed?</p>
  
  <p>Updated:</p>
  
  <p>I could see that the service-connection is using GitHub-InstallationToken (using azure pipelines app). And based on my last searches when we use GitHub token, then we can not use it more than one time for fetching repos under one pipeline however in this pipeline we are calling the GitHub service-connection two times. It looks like the token is valid for one time use. Is there any way to fix this issue?</p>