Set env to command output

Is there any way i can assign an env from a shell command, e.g.

env:

  FOO: $(cat file.txt)

10 Likes

Hi @nergnezor,

Thank you for being here! As far as I know this is not possible at this time, we do have an internal issue tracking this request and I’ve added your post and request to it. 

2 Likes

Is it available now?

You can’t do this inside the YAML, since the YAML is not evaluated in the context of a shell.  You can, however, start a shell as a step and set the environment from there using the set-env actions syntax.

For example:

run: |
  echo ::set-env name=FOO::$(echo -n "hello world")
5 Likes