Answers: <p>Thanks to @M Karimi's suggestion in comments I ended up doing a manual checkout from github with PAT</p>
  <pre><code>  - checkout: none
    - script: |
      git clone https://$(GITHUBPAT)@github.com/mycompany/project.git
      git checkout refs/tags/tag_${{parameters.MyVersion}}
  </code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2022-07-15T21:09:13.220Z
Answers: 2022-07-15T21:09:13.220Z
Answers: user3280964
Body: <p>I'm facing a problem when trying to use a parameter in my resources.</p>
  <pre><code>parameters:
  - name: MyVersion
    default: &quot;0.0.0&quot;
  
  resources:
    repositories:
    - repository: other
      type: github
      name: mycompany/project
      #Ref with parameter is not allowed
      ref: refs/tags/tag_${{parameters.MyVersion}}
      endpoint: mygithub 
  </code></pre>
  <p>While <a href="https://stackoverflow.com/questions/72400534/checkout-different-repository-as-per-input-in-azure-pipeline">this</a> could potentially help, it doesn't work for me because I'm using GitHub.   How do I do the same thing with GitHub?</p>
  <p>I tried</p>
  <pre><code>- checkout: git://mycompany/project@refs/tags/tag_${{parameters.MyVersion}}
  </code></pre>
  <p>But it tells me &quot;mycompany&quot; doesn't exist.  Which makes sense because mycompany is on GitHub and not in Azure DevOps.   How do I help Azure DevOps find it?   Also, this is a private project that requires authentication for checkout.</p>
  
Comments: CC BY-SA 4.0
Comments: 2022-07-14T06:17:49.073Z
Comments: Look at this link: https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml
Comments: M Karimi
Tags: <azure-devops><azure-pipelines>
Title: Checkout specific ref in Azure Pipeline from private GitHub
UserDisplayName: user3280964
ThreadText: # Checkout specific ref in Azure Pipeline from private GitHub
  
  (Asked by: username_0 on 2022-07-06)
  
  I'm facing a problem when trying to use a parameter in my resources.
  
  ```
  parameters:
  - name: MyVersion
    default: "0.0.0"
  
  resources:
    repositories:
    - repository: other
      type: github
      name: mycompany/project
      #Ref with parameter is not allowed
      ref: refs/tags/tag_${{parameters.MyVersion}}
      endpoint: mygithub 
  
  ```
  
  While [this](https://stackoverflow.com/questions/72400534/checkout-different-repository-as-per-input-in-azure-pipeline) could potentially help, it doesn't work for me because I'm using GitHub. How do I do the same thing with GitHub?
  
  I tried
  
  ```
  - checkout: git://mycompany/project@refs/tags/tag_${{parameters.MyVersion}}
  
  ```
  
  But it tells me "mycompany" doesn't exist. Which makes sense because mycompany is on GitHub and not in Azure DevOps. How do I help Azure DevOps find it? Also, this is a private project that requires authentication for checkout.
  
  **Tags:** azure-devops, azure-pipelines
  
  > **Comments:**
  > **username_1**: Look at this link: https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2022-07-15. Score: 0 | Accepted answer
  
  Thanks to @username_1's suggestion in comments I ended up doing a manual checkout from github with PAT
  
  ```
    - checkout: none
    - script: |
      git clone https://$(GITHUBPAT)@github.com/mycompany/project.git
      git checkout refs/tags/tag_${{parameters.MyVersion}}
  
  ```
  
  
  ---
  
  