microsoft / GHAzDO-Resources

Resources, Scripts, etc. for GitHub Advanced Security on Azure DevOps
MIT License
31 stars 14 forks source link

Samples Enhancement - Update samples to use the Enablement APIs to iterate over repos that have advanced security enabled #20

Open felickz opened 8 months ago

felickz commented 8 months ago

Use the project enablement API or org enablement APIs instead of looping through Org/Project to find repo list and then checking if individual repo is enabled. Docs - Project Enablement - REST API + Org Enablement - REST API

Further, the permissions required are simplified. To call the apis to list projects/repos required the scopes:

Enablement api just needs:

Ex: