()
| 305 | } |
| 306 | |
| 307 | public shouldExecuteStep(): boolean { |
| 308 | const hasAnyPreviousStepFailed = this.ctx.global.hasAnyPreviousStepFailed; |
| 309 | |
| 310 | if (!this.ifCondition) { |
| 311 | return !hasAnyPreviousStepFailed; |
| 312 | } |
| 313 | |
| 314 | let ifCondition = this.ifCondition; |
| 315 | |
| 316 | if (ifCondition.startsWith('${{') && ifCondition.endsWith('}}')) { |
| 317 | ifCondition = ifCondition.slice(3, -2); |
| 318 | } else if (ifCondition.startsWith('${') && ifCondition.endsWith('}')) { |
| 319 | ifCondition = ifCondition.slice(2, -1); |
| 320 | } |
| 321 | |
| 322 | return Boolean( |
| 323 | jsepEval(ifCondition, { |
| 324 | inputs: |
| 325 | this.inputs?.reduce( |
| 326 | (acc, input) => { |
| 327 | acc[input.id] = input.getValue({ |
| 328 | interpolationContext: this.getInterpolationContext(), |
| 329 | }); |
| 330 | return acc; |
| 331 | }, |
| 332 | {} as Record<string, unknown> |
| 333 | ) ?? {}, |
| 334 | eas: { |
| 335 | runtimePlatform: this.ctx.global.runtimePlatform, |
| 336 | ...this.ctx.global.staticContext, |
| 337 | env: this.getScriptEnv(), |
| 338 | }, |
| 339 | ...this.getInterpolationContext(), |
| 340 | }) |
| 341 | ); |
| 342 | } |
| 343 | |
| 344 | public skip(): void { |
| 345 | this.status = BuildStepStatus.SKIPPED; |
no test coverage detected