docs: improve error message and examples for --variables-from flag

Summary

Improves documentation and error messaging for the glab ci run --variables-from flag to address user confusion about the expected JSON format.

What was changed

  1. Enhanced error message: When JSON parsing fails, the error now includes an example of the expected format:

    Expected JSON array format: [{"key": "VAR_NAME", "value": "VAR_VALUE", "variable_type": "env_var"}]
  2. Added inline example: The help text now includes a complete, commented example showing how to create and use a variables.json file with the correct structure.

Why

Users were confused by the expected JSON format for --variables-from, naturally assuming a simple {"KEY": "value"} object structure would work, but the command actually requires an array of objects with key, value, and optional variable_type fields. The unhelpful error message didn't guide users toward the correct format.

Closes #7715 (closed)

Merge request reports

Loading