In this post I want to cover one way you can get GitHub Actions information using the GitHub connector in Power BI.
I want to cover this to help others who are looking to use the Power BI connector to get GitHub Actions information. With this in mind, by the end of this post you will know how you can do this.
One key point before I start is that the GitHub connector is currently in preview. It has been for some time now. In fact, I covered it in a post last year that showed how to create one Power BI report for both Azure Boards and GitHub.
For this post I used a private GitHub repository that is similar to my GitHub-SynapseServerlessSQLPool public GitHub repository. Which anybody can download. It contains a template to perform CI/CD for Azure Synapse Analytics serverless SQL Pools using GitHub Actions.
How to create one Power BI report
In order to get data from GitHub into Power BI desktop I first created a new page. From there, I selected ‘Get Data’ and then ‘More’.
In the get Data Window I searched for GitHub and selected ‘GitHub (Beta)’.
Because the GitHub connector is still in preview in Power BI, I had to click the ‘Continue’ button in the below window.
Afterwards I entered the GitHub repository details.
Once I clicked ‘OK’ I got asked what data to select. So, I selected ‘GitHub.Contents’ and then I clicked the ‘Transform Data’ button. Which opened up Power Query Editor.
I then entered in the URL in the format of the below example:
Once I had entered in the URL, I clicked the Invoke button to run the function.
You can find a good example of the format for the URL within the GitHub Connector Sample page in the Microsoft documentation. From there you can use the REST API site in GitHub Docs to find the REST API references.
After I had clicked the button, I navigated to the list that was returned. From there I converted it to a table and expanded the columns where required.
From there I expanded columns where needed. I renamed the results of the function to ‘GitHub Actions Details’ and did some tidying up of the column names. Once I had finished, I clicked the ‘Close & Apply’ button in Power Query Editor.
This left me with a nice table of results and made the below fields available for various visualizations.
GitHub Actions information in Power BI example
For example, I can add the below visual to the report that I created in my post about one Power BI report for both Azure Boards and GitHub. To get a breakdown of all the GitHub Actions each person had run during a sprint.
More GitHub Actions
If you want to know more about GitHub Actions, Sander Stad (l/t) and myself are presenting about it in-person at Techorama next week. Which is an in-person event that is taking place in the Netherlands.
We will be presenting a session called ‘Unveiling the magic of CI/CD for SQL Server using GitHub Actions‘ on Wednesday October 12th. I am excited about presenting this session. Mostly due to the fact that it is the first time that I have spoken in the country that I live in for years.
Final words about getting GitHub Action information using the GitHub connector in Power BI
I hope me showing one way you can get GitHub Action information using the GitHub connector in Power BI has been useful.
In reality, there are other ways to get this data from GitHub, However, I wanted to show how you can do it with this connector. Plus, how to enter the details into the GitHub.Contents function properly.
Of course, if you have any comments or queries about this post feel free to reach out to me.
Be First to Comment