An optional JMESPath filter can be configured when adding Azure Repos integration or repositories.
1. Contains (include)
{value:value[?contains(name, 'example')]}
This is a filter based on text in the repository name. It will list repositories with names containing the word 'example'
. Do note that the declared string format is case-sensitive.
2. Contains (exclude)
{value:value[?(!contains(name, 'Test'))]}
The "!"
expression excludes all repositories with 'test'
in the repository name.
3. Starts with or ends with
{value:value[?(starts_with(name, 'git')||(ends_with(name, 'test')))]}
{value:value[?(starts_with(name, 'git') || (ends_with(name, 'test')))]}
Lists repositories with names that starts with 'git'
or ends with 'test'
.
Other examples
{value:value[?contains(project.state, 'wellFormed')]}
{value:value[?contains(project.name, 'test2')]}
{value:value[?contains(project.visibility, 'private')]}
{value:value[?contains(project.visibility, 'public')]}
-
Displays repositories from projects where its state is completely created and ready to use.
-
List all repositories from project named “test2“.
-
Displays all private repositories.
-
Displays all public repositories.
Git services that support JMESPath filters
-
Microsoft | VSTS | TFS | Azure Repos JMESPath filter examples (this page)