Step YAML description language

更新时间:
复制 MD 格式

This topic describes how to use YAML to describe steps.

Item properties

Property name

Description

Required

Default value

Applicable item types

name

A unique identifier for the item. It is used as the key for the environment variable in `step.sh`.

Yes

None

All

type

The type of an item determines how it is displayed.

  • input

  • password

  • textarea

  • shell

  • select

  • checkbox

Yes

None

All

rules

Validation rules. For example:

rules:
  -required     # Specifies that the field is required.
  -length:        # Validates the input length.
     min: 4
     max: 10
  -regex: xxxxxx    # Validates the regular expression.

No

None

input/password

label

The title of the item displayed in the form.

Yes

None

All

datasource

A static data source. The value is an array.

datasource:
  - label: Option 1
    value: value1
  - label: Option 2
    value: value2

No

None

select

showCondition

The display condition. For example:

- name: abc
  label: Parameter abc
  type: select
  datasource:
    - label: Option 1
      value: 123
    - label: Option 2
      value: 456
- name: edf
  label: Parameter edf
  type: input
  showCondition: ${abc} == "123"

In this example, the configuration options for the edf parameter are displayed only when the abc parameter is set to Option 1.

No

None

All

value

The default value.

No

None

input

description

Displays a question mark to the right of the item. The question mark shows a hint.

No

None

All

Item type list

input

A standard input box.

password

An input box that displays characters as asterisks.

textarea

A standard text area.

shell

A text area with syntax highlighting for the Bash language.

select

A drop-down list.

checkbox

The value is `true` when the box is checked and `false` when it is not.

The following image shows examples of different item types.