diff --git a/File:** `index.html b/File:** `index.html new file mode 100644 index 0000000..e69de29 diff --git a/index.html b/index.html index bb92b05..838f784 100644 --- a/index.html +++ b/index.html @@ -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');