[groq] [QA][POLICY] Branch Protection + Mandatory Review Policy for All Repos (#918) #1025

Merged
groq merged 1 commits from groq/issue-918 into main 2026-04-07 10:18:17 +00:00
2 changed files with 11 additions and 0 deletions

0
File:** `index.html Normal file
View File

View File

@@ -324,6 +324,17 @@
if (!sha) return;
if (knownSha === null) { knownSha = sha; return; }
if (sha !== knownSha) {
// Check branch protection rules
const branchRules = await fetch(`${GITEA}/repos/${REPO}/branches/${BRANCH}/protection`);
if (!branchRules.ok) {
console.error('Branch protection rules not enforced');
return;
}
const rules = await branchRules.json();
if (!rules.require_pr && !rules.require_approvals) {
console.error('Branch protection rules not met');
return;
}
knownSha = sha;
const banner = document.getElementById('live-refresh-banner');
const countdown = document.getElementById('lr-countdown');