1

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 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.

1

1 Answer 1

0

Thanks to @M Karimi'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}}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.