Release Branch Auto-Cutter
On Approvals response 'Cut release for sprint X', creates a new release/x.y branch ref from the latest main SHA via Create A Reference and posts the new branch link in a Teams release channel.
Overview
Puts a governance checkpoint in front of GitHub release-branch creation. A developer or release manager starts the flow with a sprint identifier (e.g. 2026.04 or 1.2), which kicks off an approval. Once approved, the flow reads the current head SHA of the base branch in the configured GitHub repo, creates a new release branch from that SHA, and posts a link in a Teams release channel. If rejected, Teams is notified.
**State:** Off (Stopped)
Use Case
Release-branch creation is typically a two-step process: a release manager decides *when* to cut the branch, and someone with write access actually creates it. As release cadence tightens and more teams touch the same repo, manual branch creation becomes both a coordination bottleneck and an audit-trail weakness.
This flow formalizes the process — sprint owner triggers, release manager approves (tracked in Approvals center), branch cut programmatically, Teams broadcast for searchable notification, Approvals history for audit trail. Ideal for predictable release cadences, audit needs, non-technical stakeholder branch initiation.
Flow Architecture
Trigger: **Power Apps (V2) manual trigger** with `Sprint Identifier` text input.
1. Init 7 vars from env (owner, repo, base branch, release prefix, approver email, Teams group + channel)
2. Init varSprint from trigger input
3. Init varReleaseBranchName = `concat(prefix, sprint)`
4. **Start_Release_Approval** (StartAndWaitForAnApproval Basic to approver email)
5. **Check_Approval_Outcome** (If: outcome == 'Approve')
- Approve: Get_Base_Branch_Reference (SHA) → Create_Release_Branch_Reference (refs/heads/{name}, sha) → Post_Release_Branch_To_Teams (link + sprint + approver)
- Reject: Post rejection notice to TeamsEnvironment Variables
| Variable | Schema Name | Type | Default | Purpose |
|---|---|---|---|---|
| GitHub Owner | flowlibs_GitHubOwner | String | (none) | GitHub user or org that owns the target repository |
| GitHub Repo | flowlibs_GitHubRepo | String | (none) | Target GitHub repository name |
| GitHub Base Branch | flowlibs_GitHubBaseBranch | String | main | Branch to read head SHA from when cutting |
| Release Branch Prefix | flowlibs_ReleaseBranchPrefix | String | release/ | Prefix applied to sprint identifier for new branch |
| Approver Email | flowlibs_ApproverEmail | String | (none) | UPN/email of the release manager who approves |
| Teams Group ID | flowlibs_TeamsGroupId | String | (none) | ID of the Teams team that owns the release channel |
| Teams Channel ID | flowlibs_TeamsChannelId | String | (none) | ID of the Teams channel for branch-cut notifications |
Connectors & Connections
| Connector | API Name | Connection Format | Usage |
|---|---|---|---|
| Approvals | shared_approvals | connection ref | StartAndWaitForAnApproval (Basic) |
| GitHub | shared_github | connection ref | GetReference + CreateReference |
| Microsoft Teams | shared_teams | connection ref | PostMessageToConversation (×2 — approve + reject branches) |
Customization Guide
1. Update env vars (owner, repo, base branch, prefix, approver, Teams target).
2. Bind 3 connection refs.
3. Turn on.
**Common Modifications:** change base branch (develop, trunk); different naming convention (rel/, releases/, hotfix/); group approver via ;-separated emails; chain multiple approvers (tech lead + release manager); emit more metadata in Teams; swap Teams for Slack/email.
Key Expressions
- concat(variables('varReleasePrefix'), variables('varSprint')) — release branch name
- outputs('Get_Base_Branch_Reference')?['body/object/sha'] — base SHA from GetReference
- concat('refs/heads/', variables('varReleaseBranchName')) — full ref for CreateReference
- equals(outputs('Start_Release_Approval')?['body/outcome'], 'Approve') — approval check