This automation ensures that pull requests touching specialized domains or carrying designated GitHub labels receive formal approval from at least one designated Subject Matter Expert (SME) before merging.
Because GitHub's standard CODEOWNERS and branch protection review rules require dedicated GitHub Enterprise seats for every code owner, this automation runs as a standard GitHub Actions status check (Check SME Approvals). It enforces SME approvals on designated labels with zero seat license overhead.
You do not need to manually create labels on GitHub or have repository admin permissions.
New labels are created automatically on GitHub whenever a pull request with changes to .github/label_reviewers.yaml is merged into master.
.github/label_reviewers.yaml.master, GitHub Actions automatically detects the new label and creates it in the repository.(Optional) To have GitHub automatically attach this label to future PRs based on touched file paths, add matching path rules to .github/labeler.yml:
# Example entry in .github/labeler.yml: security: - changed-files: - any-glob-to-any-file: - "src/crypto/*" - "src/crypto/**/*"
The reviewer list is managed in .github/label_reviewers.yaml.
The YAML file is strictly structured as a mapping of label names to lists of GitHub usernames:
<label_name>: - <github_username_1> - <github_username_2>
Security matches security, Cecille matches cecille).@: Usernames must not include leading @ (use username, not @username).username, 'username', or "username"). Quotes are not required for standard GitHub usernames.security and certification), approval from at least one reviewer from any of the attached labels' lists satisfies the check.no-sme-check-required, sdk-maintainer-approved): Attaching either the no-sme-check-required or sdk-maintainer-approved label to a PR bypasses the SME review requirement completely, allowing emergency fixes, exempt PRs, or maintainer-approved changes to pass the status check without designated SME sign-off.CHANGES_REQUESTED or the approval is DISMISSED, the approval is no longer valid until re-approved.# Core architecture & SDK infrastructure core: - cecille - andy31415 # Security & Cryptography reviews security: - cecille - bzbarsky-apple # Data Model & Cluster XML specifications data-model: - bzbarsky-apple - Boris-Virk
git checkout -b update-sme-reviewers
.github/label_reviewers.yaml to add the label and username(s).git add .github/label_reviewers.yaml git commit -m "Update SME reviewers for <domain>" git push origin update-sme-reviewers
master, all future and open PRs will use the updated reviewer list.Once the designated SME has reviewed and submitted an APPROVED review, you have several quick ways to update the check:
The workflow actively listens to GitHub's pull_request_review events (submitted, edited, dismissed).
As soon as the SME submits an “Approved” review, the workflow automatically re-runs and updates to green without any manual intervention.
/check-sme)You can trigger an immediate re-evaluation directly from the PR conversation page:
/check-sme
Check SME Approvals check immediately.Check SME Approvals in the status checks list at the bottom of the Conversation tab).Removing and re-adding the monitored label (or adding any other label) triggers the labeled / unlabeled PR event and immediately re-evaluates the check.
no-sme-check-required, sdk-maintainer-approved)If a PR needs to merge without designated SME review (e.g. an emergency hotfix, exempt change, or SDK maintainer sign-off), attach either the no-sme-check-required or sdk-maintainer-approved label to the pull request. The check will immediately pass and record that the SME review was bypassed.
To prevent pull requests from merging until the SME review check passes:
master).Check SME Approvals
[!NOTE] Unlike standard GitHub “Require review from Code Owners”, setting
Check SME Approvalsas a required status check does not consume any GitHub Enterprise seats or require external subscription services.
The underlying verification script uses the GitHub CLI (gh) and can also be run locally on a developer workstation or cloudtop:
# Ensure GitHub CLI is authenticated (via gh auth login or GH_TOKEN) gh auth status # Run unit tests python3 -m unittest scripts/tools/tests/test_check_label_reviewers.py # Validate YAML configuration syntax and format locally python3 scripts/tools/check_label_reviewers.py --validate-config # Run check on a specific PR python3 scripts/tools/check_label_reviewers.py --pr 30000 # Test with a custom config file python3 scripts/tools/check_label_reviewers.py --pr 30000 --config /path/to/custom_reviewers.yaml