'In GitHub, is there a way to search for specific text in a particular team?

I'm currently inside an organisation in GitHub, which is divided into several teams. I have previously used the GitHub search bar to search for specific text inside a repository, and after starting to use GitHub Enterprise I also started searching by organisation as well.

However, in some scenarios I don't want to search inside the whole organisation, but only inside content owned by a particular team. I tried the syntax below:

org:<ORG> team:<TEAM> <text to search>

Which isn't referenced in any docs that I looked so far, but I got the result below:

GitHub search error: " is not a valid team name."

Which make me think that is actually possible to do some searching based on a team, since the error was about the team's name, and not about the search syntax.

So, is there a way to search based on a team? If so, how should I do it?



Solution 1:[1]

In order to search with the team: or team-review-requested: filters you need to use the team's full name, which would be in the format of <org>/<team>, see GitHub's docs on using search to filter issues and pull requests. In your example, the following query should work:

org:<ORG> team:<ORG>/<TEAM> <text to search>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Xavier