How to use template variables in orb parameters?

Hi! I’m trying to use {{ .Branch }} in one of the params from a step of the aws-s3 orb.

This is what my configuration looks like:

- aws-s3/sync:
          from: coverage
          to: 's3://my-bucket/coverage/{{ .Branch }}'
          arguments: |
            --acl public-read \
            --cache-control "max-age=86400"
          overwrite: true

Coverage is the folder I’m trying to update, and I want to update one per branch.

This is the orb I’m using

And this is the error I get:

#!/bin/bash -eo pipefail
aws s3 sync \
  coverage s3://padbol-matcher/coverage/{{ .Branch }} --delete \
  --acl public-read \
--cache-control "max-age=86400"

Unknown options: .Branch,}}

So clearly, that line is not being transpiled by CircleCi, anyone has any ideas on how to solve it?
Thanks in advance!

I think the template parameters only work in the commands designed to use then. Outside of those commands, you have environment variables that we inject into the containers. For example, open up the “spin up environment” section of this job and you’ll see many available environment variables. One of which is CIRCLE_BRANCH, which you can use like any other environment variable $CIRCLE_BRANCH. Can you try that and see if it interprets the envar correctly? it may depend on how the orb is handling that string.