Script Functions¶
The Expr Language Definition is a great resource to learn more about the language
pull_request¶
pull_request.state_is(string...) -> boolean
¶
Check if the pull_request
state is any of the provided states
Valid options:
CLOSED
- In closed stateMERGED
- Pull Request has been mergedOPEN
- Opened Pull Request
pull_request.modified_files(string...) -> boolean
¶
Returns wether any of the provided files patterns have been modified in the Pull Request.
The file patterns use the .gitignore
format.
pull_request.modified_files_list(string...) -> []string
¶
Returns an array of files matching the provided (optional) pattern thas has been modified in the Pull Request.
The file patterns use the .gitignore
format.
pull_request.has_label(string) -> boolean
¶
Returns wether any of the provided label exist on the Pull Request.
pull_request.labels = ["hello"]
pull_request.has_label("hello") == true
pull_request.has_label("world") == false
pull_request.has_no_label(string) -> boolean
¶
Returns wether the Pull Request has the provided label or not.
pull_request.labels = ["hello"]
pull_request.has_no_label("hello") == false
pull_request.has_no_label("world") == true
Global¶
duration(string) -> duration
¶
Returns the time.Duration
value of the given string str.
Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h", "d" and "w".
uniq([]string) -> []string
¶
Returns a new array where all duplicate values has been removed.
filepath_dir
¶
filepath_dir
returns all but the last element of path, typically the path's directory. After dropping the final element,
Dir calls Clean on the path and trailing slashes are removed.
If the path is empty, filepath_dir
returns ".". If the path consists entirely of separators, filepath_dir
returns a single separator.
The returned path does not end in a separator unless it is the root directory.
limit_path_depth_to
¶
limit_path_depth_to
takes a path structure, and limits it to the configured maximum depth. Particularly useful when using generated
labels from a directory structure, and want to to have a label naming scheme that only uses path of the path.