Label Governance Report
Monthly flow lists labels across all monitored repos using Lists All Labels For A Repository, flattens them into a SharePoint list, and emails ops a report of non-standard labels not matching the org style guide.
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
This flow scans a GitHub repository's labels on a monthly schedule, identifies any labels that don't match the organization's style-guide prefixes, logs violations to a SharePoint audit list, and emails the Operations team a branded report. It runs at 06:00 EST on the 1st of every month.
Use Case
Organizations enforce label naming conventions to keep issue tracking organized and searchable. Manual label audits are tedious and miss new violations in real time. This flow automates the audit process, flagging non-compliant labels and archiving violations for compliance review.
The flow is ideal for teams that:
- Automatic monthly label audit — no manual sweeps required
- Violations logged to SharePoint for compliance auditing
- Branded HTML email report makes findings easy to action
- Case-insensitive prefix matching prevents style-guide confusion
- Configurable style-guide prefixes via env vars — no flow edits needed
Flow Architecture
Monthly Recurrence
RecurrenceRuns at 06:00 EST on the 1st of every month.
Hydrate Environment Variables
7× Initialize VariableInitializes seven variables from env vars: GitHubOwner, GitHubRepository, LabelStyleGuidePrefixes, SharePointSiteUrl, ListName, NotificationEmail, and NonStandardCount.
Get All Labels For Repository
GitHub - GetLabelsCalls the GitHub Lists All Labels For A Repository action with per_page: 100 to retrieve every label on the configured repo.
If Non-Standard Labels Found
If conditionBranches on whether any labels failed the style-guide prefix check.
- For Each Violation — Iterates the filtered non-standard labels.
- SharePoint - Create Item — Writes each violation to the audit list with Title, RepositoryOwner, RepositoryName, LabelColor, LabelDescription, ViolationReason, ScanDate, and LabelUrl.
- Compose HTML Report — Builds a branded red HTML table summarizing the violations.
- Outlook - Send Email V2 — Emails the Operations team the red violations report.
No violations found — send a green All Clear email instead.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_GitHubOwner | String | <configure> | GitHub organization or user account that owns the repo being audited. |
| flowlibs_GitHubRepository | String | <configure> | Repo name whose labels we audit. |
| flowlibs_LabelStyleGuidePrefixes | String | bug:;feature:;chore:;docs: | Semicolon-separated list of acceptable label prefixes (case-insensitive match). |
| flowlibs_SharePointSiteURL | String | https://your-tenant.sharepoint.com/sites/<your-site> | Root SharePoint site hosting the audit list. |
| flowlibs_ListName | String | Label Governance Audit | Display name of the SharePoint list that stores label violations. |
| flowlibs_NotificationEmailAddress | String | alerts@yourcompany.com | Report recipient (semicolon-separated list supported). |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| GitHub | shared_github | GetLabels (Retrieves all labels from the repo.) |
| SharePoint Online | shared_sharepointonline | GetItems CreateItem (Writes violation rows to the audit list.) |
| Office 365 Outlook | shared_office365 | SendEmailV2 (Sends the red violations report or green All Clear email.) |
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.
- Deploy to Another Environment
- Import the solution, create the SharePoint audit list with the required columns (Title, RepositoryOwner, RepositoryName, LabelColor, LabelDescription, ViolationReason, ScanDate, LabelUrl), update the six env vars with your target values, open the flow in the designer to clear Flow Checker notices about dynamic SharePoint schema binding, bind the three connection references (GitHub, SharePoint, Outlook), and turn the flow on. First run happens at 06:00 EST on the 1st of the next month; use Run to test immediately.
- Add Slack notification
- Insert a Slack PostMessage action after the Outlook SendEmailV2 to cross-post the report.
- Customize the style-guide prefixes
- Edit flowlibs_LabelStyleGuidePrefixes to your org's conventions (case-insensitive match applied in filter).
- Change scan frequency
- Modify the Recurrence trigger from Monthly to Weekly or daily in Recurrence settings.
- Skip SharePoint writes on clean runs
- The If branch already does this — the False branch only sends an all-clear email.
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.01Scan date (reused)
Captured once at the start of the run and reused so every violation row and email share the same timestamp.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.