diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e7e6bd2..16d998e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -13,20 +13,4 @@ timmy-home/ @perplexity timmy-config/ @perplexity # Owner gates -hermes-agent/ @Timmy -# CODEOWNERS - Mandatory Review Policy - -# Default reviewer for all repositories -* @perplexity - -# Specialized component owners -hermes-agent/ @Timmy -hermes-agent/agent-core/ @Rockachopa -hermes-agent/protocol/ @Timmy -the-nexus/ @perplexity -the-nexus/ai/ @Timmy -timmy-home/ @perplexity -timmy-config/ @perplexity - -# Owner gates -hermes-agent/ @Timmy +# Require @Timmy for hermes-agent diff --git a/gitea-branch-protection.js b/gitea-branch-protection.js index 17897d7..6213ab0 100644 --- a/gitea-branch-protection.js +++ b/gitea-branch-protection.js @@ -1,5 +1,5 @@ const GiteaApiUrl = 'https://forge.alexanderwhitestone.com/api/v1'; -const token = 'your-gitea-access-token'; // Should be stored securely in environment variables +const token = process.env.GITEA_TOKEN; // Should be stored securely in environment variables const repos = ['hermes-agent', 'the-nexus', 'timmy-home', 'timmy-config']; const branchProtectionSettings = { @@ -10,8 +10,34 @@ const branchProtectionSettings = { requiredStatusChecks: true, blockForcePush: true, blockDelete: true + // Special handling for the-nexus (CI disabled) }; +async function applyBranchProtection(repo) { + try { + const response = await fetch(`${giteaApiUrl}/repos/Timmy_Foundation/${repo}/branches/main/protection`, { + method: 'POST', + headers: { + 'Authorization': `token ${token}`, + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + ...branchProtectionSettings, + // Special handling for the-nexus (CI disabled) + requiredStatusChecks: repo === 'the-nexus' ? false : true + }) + }); + + if (!response.ok) { + throw new Error(`Failed to apply branch protection to ${repo}: ${await response.text()}`); + } + + console.log(`✅ Branch protection applied to ${repo}`); + } catch (error) { + console.error(`❌ Error applying branch protection to ${repo}: ${error.message}`); + } +} + async function applyBranchProtection(repo) { try { const response = await fetch(`${giteaApiUrl}/repos/Timmy_Foundation/${repo}/branches/main/protection`, {