How to: Exploring GitHub APIs to create reports on PowerBI
These PowerSell scripts explores GitHub APIs and create reports out of the box
During the process of learning GitHub, I started exploring its APIs and creating useful reports, mainly for the tool’s administrators. Below are some examples of this undertaking (click on each link for more details):
- List GitHub default Branch protection rules = this report extract all default branch protection rules in all repositories within the GitHub organization.
Every time we are creating repositories on GitHub and we need to apply protection rules on these repositories. Over time and with a large number of repositories, it becomes increasingly difficult to verify that all these repositories have the same protections applied. Thinking about it, I decided to create this report that extracts all repositories, respective default branch and all protection rules applied.
- Create Dashboard to visualize Branches ahead/behind on GitHub = this report extract all repositories and branches on GitHub to identify the gap between each branch and the default branch
- List user Repositories and respective Forks on GitHub = This report extract all user repositories and forks on GitHub in the timeline
- List user Repositories and respective Stargazers on GitHub = This report extract all user repositories and stargazers on GitHub in the timeline
- Secrets Mapping on GitHub = This script and report extract all secrets (organization, repositories and environments) within the GitHub organization. Many customers on GitHub use secrets to store sensitive information in your organization, repository, or repository environments to use in GitHub Actions workflows. Thinking about it, this report maps all secrets between these three levels (organization, repositories and environments) and presents them below.
- Variables Mapping on GitHub = this report extract all variables (organization, repositories, and environments) within the GitHub organization. Many customers on GitHub use variables to store shared information in your organization, repository, or repository environments in GitHub Actions workflows. Thinking about it, this report maps all variables between these three levels (organization, repositories, and environments) and presents them below.