Skip to content

Docs: Push options for GitLab CI/CD ci.input=<name>=<value> array example wrong

Problem to solve

Document

The documentation gives the following example for the use of the push option ci.input with arrays:

    Example with an array of strings: `ci.input='["string", "double", "quotes"]'`

This however does not follow what it says at the begin of the line and also doesn't function. As it is missing the <name> for the array.

   `ci.input=<name>=<value>`

Further details

I have reproduced the issue here:

Git command without the <name> for an array: https://gitlab.com/klokkenman1/test-ci.variable/-/jobs/10981535101#L75

Resulting pipeline uses the default for the array: https://gitlab.com/klokkenman1/test-ci.variable/-/jobs/10981545489#L23

Defaults are defined here: https://gitlab.com/klokkenman1/test-ci.variable/-/blob/main/.gitlab-ci.yml?ref_type=heads#L4

Functional

Git command that does use the <name> for an array https://gitlab.com/klokkenman1/test-ci.variable/-/jobs/10981614156#L75

Resulting pipeline uses the correct values for the array: https://gitlab.com/klokkenman1/test-ci.variable/-/jobs/10981620993#L23

You might notice the functional push command does not have quotes as the example does but this might be GitPython encapsulating it and not showing it.

Proposal

Change

    Example with an array of strings: `ci.input='["string", "double", "quotes"]'`

to

    Example with an array of strings: `ci.input='type=["string", "double", "quotes"]'`

Who can address the issue

Anyone could address the issue but validating might need pipeline composition/authoring.

Other links/references

Related MR by me that also addresses the weird quote behavior in more detail but that can be removed. !198647 (closed) (closed)

Edited by 🤖 GitLab Bot 🤖