0

In my pipeline definition, for getting resources from other pipeline, I'd like to define a default tags value to use, such as "release candidate", but allow to select to use any tags or even without tag. Is there a simple way to do so?

Here's my attempt but seems like "*" doesn't work:(

parameters:
- name: TagsToUse
  displayName: 'Select the tags to use for artifact from pipeline xxxx'
  type: string
  default: 'release candidate'
  values:
  - 'release candidate'
  - '*'

resources:
  pipelines:
  - pipeline: xxxx
    project: 'MyProject'
    source: 'TargetSource'
    branch: 'master'
    tags: ${{ parameters.TagsToUse }}
...
...
...
2
  • My gut feeling is you can't. Not everything in yaml pipelines is equal or interpreted the same way. You could try a condition but I think it might not be valid - ${{ if ne(parameters.tags, '*') }}:
    – ste-fu
    Jul 27 at 10:37
  • hum... thanks for your answer. Jul 31 at 13:35

1 Answer 1

0

Using values: is a way to restrict what can be passed into the parameters. For this reason, there isn't a way to wildcard an input value.

Since what you want to do is allow anything but default to 'release candidate' if nothing is provided, you really only need default: and can remove the values: restriction.

Your Answer

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

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