@@ -140,12 +140,12 @@ description: |
140140 existing values in the matrix. For instance, consider an entry in the matrix that has
141141 the `x86` factor set to true.
142142
143- When using `b2`, we should set `address-model=32` for this entry. Otherwise, we should set
143+ Assume we are using `b2` and should set `address-model=32` for this entry. Otherwise, we should set
144144 `address-model=64`. With GitHub expressions, we can generate this value based on the `x86` factor:
145145
146146 `b2 address-model={{ matrix.x86 && '32' || '64' }}`
147147
148- If this pattern needs to be repeated in many entries, this pattern might become cumbersome.
148+ If this pattern needs to be repeated in many entries, it might become cumbersome.
149149 In this case, the action allows the user to define extra values to be injected in each entry
150150 of the matrix. These values can be used to generate new values based on existing values in
151151 the matrix with handlebars. You could set the following extra values in each entry of the matrix:
@@ -159,6 +159,45 @@ description: |
159159 run: |
160160 b2 address-model={{ matrix.address-model }}
161161 ----
162+
163+ or
164+
165+ [source,yml]
166+ ----
167+ extra-values: |
168+ address-model-arg: address-model={{#if x86}}32{{else}}64{{/if}}
169+
170+ # ...
171+ run: |
172+ b2 {{ matrix.address-model-arg }}
173+ ----
174+
175+ The syntax for each entry in the `extra-values` input is a key-value pair, where the key is the name of the
176+ value to be injected in the matrix and the value is a handlebars expression that generates the value based on
177+ other values in the matrix. The handlebars expression can access previous values in the matrix, including
178+ other extra values.
179+
180+ Besides referencing other values in the matrix, the handlebars expressions can also use the
181+ built-in https://handlebarsjs.com/guide/builtin-helpers.html[helpers] provided by Handlebars and the
182+ predefined helpers defined by the action:
183+
184+ [cols="1,3"]
185+ |===
186+ | Helper | Description
187+ | `lowercase` | Converts the value to lowercase
188+ | `uppercase` | Converts the value to uppercase
189+ | `contains` | Checks if the value contains a substring
190+ | `startsWith` / `starts-with` | Checks if the value starts with a substring
191+ | `endsWith` / `ends-with` | Checks if the value ends with a substring
192+ | `substring` | Extracts a substring from the value
193+ | `and` | Logical AND operator
194+ | `or` | Logical OR operator
195+ | `not` | Logical NOT operator
196+ | `eq` | Equality operator
197+ | `ieq` | Case-insensitive equality operator
198+ | `ne` | Inequality operator
199+ | `ine` | Case-insensitive inequality operator
200+ |===
162201
163202 == Ordering entries
164203
0 commit comments