-
If you are looking for help, please confirm the following...
Which mobile framework are you using?Flutter (Dart) Steps to reproduce
foo:
name: foo
triggering:
events:
- pull_request
- pull_request_labeled
branch_patterns:
- pattern: "main"
include: true
source: false
when:
condition: event.pull_request.labels[0].name == "foo1"
Expected resultsI would like to know how to implement this use-case. Maybe I would like to use kind of Actual resultsTo check if any label matches with label named 'foo1', I think I need to add more condition like Build id (optional)No response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello @fummicc1, |
Beta Was this translation helpful? Give feedback.
Hello @fummicc1,
I'm afraid the
when.condition
block does not currently support array iteration or built-in methods likeArray.contains()
or any() to check if any item in a list matches a condition. The expressions are quite limited and don’t support complex logic or scripting including usingor
or||
.This condition check is best used when you are triggering based on only one variable in the response. A workaround I can think of here at the moment is making use of GitHub API in your script to fetch the Payload of the Pull request, and with that, you can use a script early in your workflow to fetch the PR labels and decide whether to continue the build or exit early. It’s a bit of a proce…