GitHub Commit to Dataverse Change Log
When a commit is pushed to a GitHub repo, log the commit hash, message, author, and timestamp to a Dataverse table.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
FlowLibs - GitHub Commit to Dataverse Change Log captures GitHub push webhook events and writes one row per commit into a dedicated Dataverse change-log table. Every commit's SHA, message, author identity, timestamp, repository, branch, and URL becomes a queryable Dataverse record — giving teams an audit trail that survives forks, force-pushes, or repo deletions on GitHub.
The flow ships Off as a reference implementation. Turning it on requires only two hooks: authorize the embedded Dataverse connection and configure the three environment variables (owner, repo, branch) so the filter only logs commits from the watched repository.
Use Case
Teams that need a tamper-resistant commit ledger inside the Power Platform — for compliance reporting, build-trigger correlation, change-management dashboards, or feeding downstream Power BI / Power Apps.
The flow is ideal for teams that:
- Audit & compliance — Regulated environments that must retain an authoritative copy of source-control activity outside GitHub.
- Cross-system traceability — Linking commits to Dataverse-tracked work items, deploys, or incidents through downstream flows.
- Reporting — Power BI dashboards over commit velocity by author, branch, or repository without hitting the GitHub API for every report refresh.
- Defensible change-log — Capturing the commit history at the moment of the push, so later force-pushes or branch deletions on GitHub do not erase the record.
Flow Architecture
manual
Request (HTTP)Receives the GitHub `push` webhook. Schema declares `repository`, `pusher`, `head_commit`, `commits[]`, and `ref`.
Initialize Allowed Owner
Initialize VariableReads `flowlibs_GitHubOwner` env var into `varAllowedOwner`.
Initialize Allowed Repo Name
Initialize VariableReads `flowlibs_GitHubRepoName` env var into `varAllowedRepoName`.
Initialize Allowed Branch
Initialize VariableReads `flowlibs_GitHubBranch` env var (e.g. `refs/heads/main`) into `varAllowedBranch`.
Check If Repo And Branch Match
If conditionThree-way `AND` test: owner == varAllowedOwner, repo == varAllowedRepoName, ref == varAllowedBranch.
- For Each Commit In Push — Apply to each over `triggerBody()?['commits']`.
- Log Commit To Dataverse — Dataverse `CreateRecord` — writes one row to `flowlibs_githubcommitlogs` per commit (SHA, message, author, timestamp, repo, branch, URL).
Terminate (Succeeded) — cleanly exits when the push was for an unrelated repo/branch.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_GitHubOwner | String | <configure> | GitHub repository owner (user or org) compared to `repository.owner.login`. Set this to the GitHub username or organization that owns the watched repo. |
| flowlibs_GitHubRepoName | String | sample-repo | GitHub repository name compared to `repository.name`. Set this to the name of the repo you want to log commits from. |
| flowlibs_GitHubBranch | String | refs/heads/main | Branch ref compared to the webhook `ref` field. Must include the full `refs/heads/` prefix because GitHub sends it that way. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Microsoft Dataverse | shared_commondataserviceforapps | CreateRecord (Writes one row per commit to `flowlibs_githubcommitlogs`.) |
| GitHub | n/a (HTTP webhook) | push webhook (GitHub repo → Settings → Webhooks → set Payload URL to the flow's HTTP trigger URL, Content-Type `application/json`, event `push`.) |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Watch a different repository
- Update the three env vars (flowlibs_GitHubOwner, flowlibs_GitHubRepoName, flowlibs_GitHubBranch) — no flow edit needed. Per the FlowLibs zero-edit principle, all repository scoping is config, not code.
- Watch multiple branches
- Replace the equals test on ref with or of multiple branches, or keep the env var as a comma-separated list and split it inside the condition (e.g. contains(split(variables('varAllowedBranch'), ','), triggerBody()?['ref'])).
- Capture additional commit fields
- GitHub push payloads expose added, removed, modified file arrays per commit. Extend the Dataverse table with String/Memo columns and add matching item/... parameters in Log Commit To Dataverse.
- Enrich with author identity
- Add an Office 365 Users → Search for users action to resolve commits[].author.email to a Dataverse systemuser lookup before writing.
- Skip merge commits
- Wrap the inner Create with another If: not(startsWith(items('For_Each_Commit_In_Push')?['message'], 'Merge')).
- Wire GitHub up
- In the GitHub repo, Settings → Webhooks → Add webhook → set Payload URL to the flow's HTTP trigger URL (visible after turning the flow on), Content type application/json
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Init varAllowedOwner
Pulls from solution env var rather than hardcoding the owner.
EXPR.02Owner gate (If condition)
Owner gate. Uses safe `?[]` accessors so a malformed payload returns `null` rather than failing the flow.
EXPR.03Apply to each — commits array
GitHub push payloads always include the `commits[]` array even on single-commit pushes.
EXPR.04Dataverse entityName
Hardcoded entity set name (per FlowLibs zero-error convention — `CreateRecord` cannot resolve a variable-driven `entityName` and must use the literal).
EXPR.05Commit SHA write
Each commit's SHA-1 hash used as the natural primary key.
EXPR.06Branch write
Captures the full ref (`refs/heads/main`) so downstream Power BI can split tags vs heads cleanly.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.