An optional JMESPath filter can be configured when adding tracked folders.
1. Contains (include)
[?contains(name, 'git')]
This is a filter based on the text in the repository name. It lists repositories with the names that contain the word 'git'
. Do note that the declared string format is case-sensitive.
[?contains(name, 'git') || contains(name, 'Slap') || contains(name, 'est')]
Lists repositories with the names that contain any of the specified word.
2. Contains (exclude)
[?(!contains(name, 'firstword'))]
[?(!contains(name, 'firstword')) && (!contains(name, 'secondword'))]
1 – Lists repositories with the names that do not contain the word 'firstword'
.
2 – Lists repositories with the names that either do not contain the words 'firstword'
OR 'secondword'
.
!condition
must be wrapped in a parenthesis so it won’t invert the whole expression.
3. Starts with (exclude)
The example below ONLY works for tracked folder integrations; where it supports the 'fullPath'
field:
[?!starts_with(fullPath, '/home/user/local/store/private-repos')]
Excludes repositories from the sub-folder.
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
Tracked Folders JMESPath filter examples (this page)