From 173073d5d3290c3af7abfd96df2d9c754a0a0907 Mon Sep 17 00:00:00 2001 From: Scott McGowan Date: Fri, 11 Feb 2022 07:49:48 +0000 Subject: [PATCH] chore: update expression readme --- .github/workflows/push_main.yaml | 3 +-- script/standard/README.md | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push_main.yaml b/.github/workflows/push_main.yaml index 9433c40..0a9c0d8 100644 --- a/.github/workflows/push_main.yaml +++ b/.github/workflows/push_main.yaml @@ -71,7 +71,6 @@ jobs: verbose: true release_check: runs-on: ubuntu-latest - needs: [test, lint] outputs: git_diff: ${{ steps.output.outputs.git_diff }} steps: @@ -94,7 +93,7 @@ jobs: echo "::set-output name=git_diff::${{ env.GIT_DIFF }}" release: runs-on: ubuntu-latest - needs: [release_check] + needs: [test, lint, release_check] if: ${{ needs.release_check.outputs.git_diff }} outputs: version: ${{ steps.release.outputs.version }} diff --git a/script/standard/README.md b/script/standard/README.md index 049f86a..18e42e2 100644 --- a/script/standard/README.md +++ b/script/standard/README.md @@ -22,6 +22,8 @@ The standard script engine is a basic implementation of the script.Engine interf |`*`|multiplication|number|return the left-side number multiplied by the right-side number| |`/`|division|number|return the left-side number divided by the right-side number| |`%`|modulus|integer|return the remainder of the left-side number divided by the right-side number| +|`in`|in|number\|string\|boolean and collection|return true if the left-side argument is in the right-side collection| +|`not in`|in|number\|string\|boolean and collection|return true if the left-side argument is not in the right-side collection| All operators have a left-side and right-side argument, expect the not `!` operator which only as a right-side argument. The arguments can be strings, numbers, boolean values, arrays, objects, a special parameter, or other expressions, for example `true && true || false` includes the logical AND operator with left-side `true` and right-side a logical OR operator with left-side `true` and right-side `false`. @@ -33,6 +35,10 @@ The right side pattern should be passed as a string, between single or double qu > the regex operation is handled by the standard [`regexp`](https://pkg.go.dev/regexp) golang library `Match` function. +### In and Not In + +The `in` and `not in` operators will check if the left-side value, treated either as a number, string, or boolean value, is included in the right-side collection values, a collection can either be an array, slice, or the values of a map. + ## Special Parameters The following symbols/tokens have special meaning when used in script expressions and will be replaced before the expression is evaluated. The symbols used within a string, between single or double quotes, will not be replaced.