jq¶
Downloads a JSON or YAML file from a repository and queries it via one or more jq expressions. Matches if every query returns at least one result.
Parameters¶
expressions¶
List of jq expressions to query the file.
The implementation is based on gojq.
Use the jq playground to test expressions.
| Name | Value |
|---|---|
| Type | string[] |
| Required | Yes |
path¶
Path to the file in a repository. Supports JSON and YAML formats.
| Name | Value |
|---|---|
| Type | string |
| Required | Yes |
Examples¶
# Match if the file package.json defines a dependency on the library react.
filters:
- filter: jq
params:
expressions: [".dependencies.react"]
path: package.json
# Match if the file package.json defines a dependency on the library react and react-dom.
filters:
- filter: jq
params:
expressions:
- ".dependencies.react"
- ".dependencies.react-dom"
path: package.json
# Match if the file package.json doesn't define a dependency on the library react.
filters:
- filter: jq
params:
expressions: [".dependencies.react"]
path: package.json
reverse: true