I am trying to pass the << pipeline.git.branch >>
as a parameter to a command. This works great until someone pushes a tag to the repo.
The command is defined as follows:
parameters:
field:
description: The field of the json file to set
type: string
value:
description: The value to set the field to
type: string
steps:
- run: ...
And I am using it like this:
workflows:
generate-config:
jobs:
- gomplate/render-config:
context: dev-test
executor: vfcommon/node-executor
pre-steps:
- vfcommon/set-json-string:
field: branch
value: "<< pipeline.git.branch >>"
contexts: values.json
When << pipeline.git.branch >>
is empty (when a tag triggers the pipeline), the config fails with the following message:
Error calling workflow: 'generate-config'
Error calling job: 'gomplate/render-config'
Error calling command: 'vfcommon/set-json-string'
Unknown variable(s): value
I have tried using single-quotes, double-quotes, and no quotes. My desired behaviour would be for it to just pass it as the empty string. Any idea how I could achieve this? I believe that this is a bug, but it might be intended behaviour that I just don’t understand.