From b748c0c4e29bd0120608632e7df9d55157167a69 Mon Sep 17 00:00:00 2001 From: janbridley Date: Wed, 8 Jul 2026 10:42:00 -0400 Subject: [PATCH 1/3] Add NotEqualTo comparison --- src/workflow.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/workflow.rs b/src/workflow.rs index 45368e8..3aade5b 100644 --- a/src/workflow.rs +++ b/src/workflow.rs @@ -186,6 +186,8 @@ pub enum Comparison { LessThanOrEqualTo, #[serde(rename(deserialize = "=="))] EqualTo, + #[serde(rename(deserialize = "!="))] + NotEqualTo, #[serde(rename(deserialize = ">="))] GreaterThanOrEqualTo, #[serde(rename(deserialize = ">"))] From c7e3ba48a929ea1a06a1e8dd79a67fe68b6999a2 Mon Sep 17 00:00:00 2001 From: janbridley Date: Wed, 8 Jul 2026 10:45:34 -0400 Subject: [PATCH 2/3] Support neq and test --- src/expr.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/expr.rs b/src/expr.rs index 9e40d16..b46c02e 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -64,6 +64,7 @@ pub(crate) fn evaluate_json_comparison( (Comparison::LessThan, Some(Ordering::Less)) => Some(true), (Comparison::LessThanOrEqualTo, Some(Ordering::Less | Ordering::Equal)) => Some(true), (Comparison::EqualTo, Some(Ordering::Equal)) => Some(true), + (Comparison::NotEqualTo, Some(Ordering::Less | Ordering::Greater)) => Some(true), (Comparison::GreaterThanOrEqualTo, Some(Ordering::Greater | Ordering::Equal)) => Some(true), (Comparison::GreaterThan, Some(Ordering::Greater)) => Some(true), (_, None) => None, @@ -165,6 +166,22 @@ mod tests { evaluate_json_comparison(&Comparison::EqualTo, &Value::from(5), &Value::from(5)), Some(true) ); + assert_eq!( + evaluate_json_comparison(&Comparison::NotEqualTo, &Value::from(5), &Value::from(10)), + Some(true) + ); + assert_eq!( + evaluate_json_comparison(&Comparison::NotEqualTo, &Value::from(5), &Value::from(5)), + Some(false) + ); + assert_eq!( + evaluate_json_comparison( + &Comparison::NotEqualTo, + &Value::from(5), + &Value::from("abcd") + ), + None + ); assert_eq!( evaluate_json_comparison( &Comparison::GreaterThanOrEqualTo, From 8d430cc37dab67890ab60081e07a4fd655ec0d6d Mon Sep 17 00:00:00 2001 From: janbridley Date: Wed, 8 Jul 2026 10:45:42 -0400 Subject: [PATCH 3/3] Document --- doc/src/workflow/action/group.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/workflow/action/group.md b/doc/src/workflow/action/group.md index 82f2b24..0b6d388 100644 --- a/doc/src/workflow/action/group.md +++ b/doc/src/workflow/action/group.md @@ -30,7 +30,7 @@ Each selector is a **table** with only one of the following keys: * `condition`: An array of three elements: The *JSON pointer*, *the operator*, and the *operand*. The [JSON pointer](../../guide/concepts/json-pointers.md) references a specific portion of the directory's value. The operator may be `"<"`, `"<="`, - `"=="`, `">="`, or `">"`. Both operands **must** have the same data type. The element + `"=="`, `"!="`, `">="`, or `">"`. Both operands **must** have the same data type. The element referenced by each JSON pointer must be present in the value of **every** directory. * `all`: Array of conditions (see above). All conditions must be `true` for this selector to be `true`. `all` is evaluated with short-circuit logic. When an element in `all`