According to the docs, I could use - to exclude certain things from the search API... I tested it and this works on the language field for example, but doesn't work on topics.
According to the documentation:
note cats stars:>10 -language:javascript matches repositories with the word "cats" that have more than 10 stars but are not written in JavaScript.
But if I want to search for cats stars:>10 -topic:javascript it doesn't work anymore, although I tested it and there are exactly 9 repositories that have javascript as a topic.
So
cats stars:>10 returns 714 results
cats stars:>10 -topic:javascript returns 714 results (- doesn't work)cats stars:>10 +topic:javascript returns 9 results
cats stars:>10 -language:javascript returns 602 results (- works as expected)cats stars:>10 +language:javascript returns 112 results
There's a workaround with GitHub CLI:
Replace: ORG with organization name.
Unix:
gh repo list ORG --json name,repositoryTopics --limit 200 --jq '.[] | select(.repositoryTopics//[] | all(.name != "unwanted-label-name"))' | sort
Windows:
gh repo list ORG --json name,repositoryTopics --limit 200 --jq ".[] | select(.repositoryTopics//[] | all(.name != """unwanted-label-name"""))" | sort
For GitHub enterprise, set environment variable before running commands:
GH_HOST=your.github.enterprise.company.host
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With