Hash 1 or more files into a single hash. This function is useful for generating cache keys to detect when a file (or many files) have changed.
Things to note about the
- File globs are supported, so
file.*will expand to all files starting with
- Every file explicitly passed (ie, not a glob) must exist. If a passed file doesn't exist, the workflow fails.
- After all globs (if any) are expanded, the file list is sorted before hashing.
let hash = hashOf("package.json") let hash = hashOf("docs/**/*.md") let hash = hashOf("file1", "file2")
starts_with to check if a string starts with another string:
if event.branch.starts_with("v"): # do something here
starts_with returns a
ends_with to check if a string ends with another string:
if event.branch.ends_with("-dev"): # do something here
ends_with returns a
Strip the start and end of a string:
let name = " bob " print(name.strip())
This will print
bob when ran.
strip() returns a