Skip to content

GitHub Actions information using the GitHub connector in Power BI

Reading Time: 4 minutes

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’.

Selecting the More option in Get data
Get Data – More

In the get Data Window I searched for GitHub and selected ‘GitHub (Beta)’.

Selecting GitHub in order to get GitHub Action details using the GitHub connector in Power BI
GitHub (Beta)

Because the GitHub connector is still in preview in Power BI, I had to click the ‘Continue’ button in the below window.

Preview connector message
Preview Connector

Afterwards I entered the GitHub repository details.

Selecting the sample repository to show GitHub Action details using the GitHub connector in Power BI
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:

https://api.github.com/repos/{OWNER}/{REPOSITORY NAME}/actions/runs

Once I had entered in the URL, I clicked the Invoke button to run the function.

Invoking the function to get GitHub Action details using the GitHub connector in Power BI
Entering the URL

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.

Converting the returned results to a table
Converting results to table

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.

Available fields

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.

GitHub Actions runs per person visual
GitHub Actions Runs per person

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.

Published inGitHub ActionsPower BI

2 Comments

  1. Todd Walstad Todd Walstad

    Thanks for details, I was able to get this connected following this post!

    It seems there isn’t a “Run Time” field and calculating from the the available times doesn’t seem to work. Have you been able to get “Run Time” from this data?

    • Todd Walstad Todd Walstad

      I figured it out…it was using the wrong column, plus it wasn’t being displayed correctly.

      = Table.AddColumn(#”Changed Type”, “run_time”, each [updated_at]-[run_started_at])

      Make sure it is formatted as a time, with the format you want.

Leave a Reply

Your email address will not be published. Required fields are marked *