Release Change Digest to Teams
Manual trigger accepts two commit SHAs, runs Compare Two Commits, and posts a formatted Teams adaptive card summarizing file diffs, commit counts, and authors — perfect release-notes pre-reading.
Overview
Manual-trigger cloud flow that accepts a base and head ref (branch names or commit SHAs), calls the GitHub Compare Two Commits API, and posts a formatted HTML digest to a Microsoft Teams channel. The digest shows status, commit counts, ahead/behind counts, files-changed count, unique author names, and a direct link to the comparison on GitHub — ideal as release-notes pre-reading or a deploy sanity check.
**State:** Stopped (user activates when ready)
Use Case
Before cutting a release, an engineering lead wants a one-click summary of everything that changed between two refs — typically main vs. release branch, or last deployed SHA vs. HEAD. Rather than clicking through GitHub compare, run this flow with two refs and receive a ready-to-share digest in the team's Teams channel.
Concise enough to scan in seconds, contains the direct GitHub link for drill-down.
Flow Architecture
Trigger: **Manually trigger a flow** with `Base Commit SHA or Branch` + `Head Commit SHA or Branch` inputs. 1. Init 5 vars (owner, repo, Teams group/channel, digest title) 2. **Compare Commits In GitHub** (CompareRepositoryCommits) 3. Select Author Names (Select projects each commit to author name) 4. Compose Unique Author List (triple-replace string unwrap) 5. Compose Digest Message HTML (stats + GitHub compare link) 6. **Post Digest To Teams Channel** (PostMessageToConversation)
Environment Variables
| Variable | Schema Name | Type | Default | Purpose |
|---|---|---|---|---|
| GitHub Owner | flowlibs_GitHubOwner | String | microsoft | GitHub organization or user that owns the repo |
| GitHub Repository | flowlibs_GitHubRepository | String | power-platform | Repository name |
| Teams Group ID | flowlibs_TeamsGroupId | String | (none) | Teams group/team ID |
| Teams Channel ID | flowlibs_TeamsChannelId | String | (none) | Teams channel ID |
Connectors & Connections
| Connector | API Name | Connection Format | Usage |
|---|---|---|---|
| GitHub | shared_github | raw GUID | CompareRepositoryCommits |
| Microsoft Teams | shared_teams | shared-teams-d6c7aabb-... | PostMessageToConversation (Flow bot) |
Customization Guide
1. Set 4 env vars (owner, repo, Teams group/channel).
2. Bind connection refs.
3. Edit Init varDigestTitle for custom heading.
4. Turn on.
**Common Modifications:** include file list via second Select over body['files']; adaptive card instead of HTML; schedule it (Recurrence) instead of manual.
Key Expressions
- @coalesce(body('Compare_Commits_In_GitHub')?['commits'], json('[]')) — author projection
- Triple-replace unwrap for unique author list
- @{length(coalesce(body('Compare_Commits_In_GitHub')?['files'], json('[]')))} — files-changed count
- <a href='@{body('Compare_Commits_In_GitHub')?['html_url']}'> — GitHub comparison link