Skip to content

Feature request: complex env vars

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Wouldn't it be nice if we could declare complex variables in .gitlab-ci.yml that would be available as json strings (or some other format) in environment variables?

We could use this syntax:

variables:
  MYLIST:
  - item1
  - item2
  MYMAP:
    key1: val1
    key2: val2
  MYSTRING: |
    line1
    line2

The resulting environment variables would be:

MYLIST='["item1","item2"]'
MYMAP='{"key1":"val1","key2":"val2"}'
MYSTRING="line1\nline2"

I suppose a simple yaml->json conversion would work, and be backward compatible.

Edited by 🤖 GitLab Bot 🤖