List parameter type?



I’m new to orbs, and started playing around with creating an orb for one of my tools.

One of the parameters I want to take as input can be specified multiple times, but there doesn’t seem to be an appropriate parameter type for this, according to

In the meantime, I can use a comma-separated string, but this is a bit non-obvious and will be slightly more difficult to deal with.

Is a list parameter type planned? Or is there some undocumented support already?


We don’t yet have a generic list or collection type. One issue is that we have been hesitant to put looping constructs directly in our yaml for fear of creating a yaml-based programming language. That said, it’s clear that some way to pass multiple values would be useful, so it’s something we have on our list of improvements. Curious: how would you envision the syntax looking when you use a list? We could potentially pass it through serialized for use in shell commands, but that is a bit messier than we’d like.


Thanks for the quick response, @ndintenfass

I’m used to dealing with the Go text/template package, in fact, the tool I’m trying to Orb-ify is, which is a template renderer that uses the text/template syntax.

So I’d imagine a syntax like this:

        type: list
      - run: |
          << range parameters.alist >>echo "param is << . >>";<< end >>
  - foo_job:
      - myorb/foo:
            - first
            - second

This would output:

param is first
param is second

This is just off the top of my head, and probably isn’t as intuitive to folks who aren’t familiar with the text/template syntax!



I only mention this because of the specific example you used here @hairyhenderson, because I know this isn’t quite what you’re looking for in a broader sense, but you can use the steps parameter type to allow folks to pass a list/collection—as long as it’s a list of steps. Which would get you to your example, although it’s not quite as DRY as what you’ve outlined here.


Thanks @rose - that looks like an interesting hack - I didn’t realize steps could be used that way…

But you’re right, it’s not quite what I’m looking for… :wink:

I’ll play around with it and see if it’s enough for now.