
An optional JMESPath filter can be configured when adding Azure Repos integrations.
1. Contains (include)
value[?contains(name, 'example')] || {value:@}
This is a filter based on the text in the repository name. It lists repositories with the names that contain the word 'example'
. Do note that the declared string format is case-sensitive.
2. Contains (exclude)
value[?(!contains(name, 'test'))] || {value:@}
Lists repositories with the names that do not contain the word 'test'
.
!condition
must be wrapped in a parenthesis so it won’t invert the whole expression.
3. Starts with or ends with
value[?starts_with(name, 'git') || ends_with(name, 'test')] || {value:@}
Lists repositories with the names that start with 'git'
or end with 'test'
.
Other examples
value[?contains(project.state, 'wellFormed')] || {value:@}
value[?contains(project.name, 'test2')] || {value:@}
value[?contains(project.visibility, 'private')] || {value:@}
value[?contains(project.visibility, 'public')] || {value:@}
-
Lists repositories from projects where their state is completely created and ready to use.
-
Lists all repositories from the project named "test2".
-
Lists all private repositories.
-
Lists all public repositories.
More articles on JMESPath filter examples
GitHub.com | GitHub Enterprise JMESPath filter examples
GitHub App JMESPath filter examples
GitLab.com | GitLab CE/EE JMESPath filter examples
Microsoft | VSTS | TFS | Azure Repos JMESPath filter examples (this page)