Note
This repository contains an example project that can be used as a reference or starting point for your own projects.
Attention: This project is not supported by the GitHub product team, the GitHub support team, or Microsoft. Any questions or issues related to the use of this project must be resolved independently. However, you can open an issue to seek help from the community.
This repository contains an example of how to extract workflow execution data and create dashboards. The data is extracted from the GitHub Actions using WebHook and saved in a SQL Server database.
- Developer works on a GitHub repository.
- Developer commits code to a repository.
- GitHub triggers the GitHub Actions workflow.
- GitHub Actions sends the
workflow_job
events to the API. - GitHub Actions sends the
workflow_run
events to the API. - The API sends the JSON data to the Azure Blob Storage. The Azure Function reads the data from the Azure Blob Storage, process the JSON and saves it in the SQL Server database.
- The user accesses the Power BI dashboard to view the data.
Create GitHub secrets for Azure Login (AZ_CREDENTIALS
) and SQL Server password (AZ_SQL_PASSWORD
).
To create the Azure resources, you can update the variables values and run the workflow 01-CreateAzureResources.yml.
To deploy the API that receives the webhook payload, you can run the workflow 02-Deployment-API.yml.
Create GitHub secrets for SQL Server Connection String (AZ_SQL_CONNECTION_STRING
). created at Step 01.
To deploy the Azure Function, you can run the workflow 03-Deployment-Function.yml.
Create a GitHub Webhook to send the workflow_job
and workflow_run
events to the API endpoint.
To create the webhook, at the Organization level, click on Settings
, select the Webhooks
menu, and click on the Add webhook
button.
In the Payload URL
field, enter the API endpoint created at Step 02.
In the Which events would you like to trigger this webhook?
section, select Let me select individual events
and select the workflow_job
and workflow_run
events.
In the end, you will have two webhooks:
workflow_job
event configured to the API endpoint https://[APPNAME].azurewebsites.net/api/GitHubWorkflowJob.workflow_run
event configured to the API endpoint https://[APPNAME].azurewebsites.net/api/GitHubWorkflowRun.
Update the Power BI file GitHubActionsDashboard.pbix with the parameters for connection string and database name.
Upload the Power BI file to your Power BI Service.
If you want to contribute to this project, please read the CONTRIBUTING file.
This project is licensed under the MIT License - see the LICENSE file for details.