Skip to content

Commit 817a75a

Browse files
committed
feat: implement comprehensive bypass prevention system - Added multi-layered CI/CD protection to prevent bypassing pre-commit hooks - Created workflows for pre-commit validation, branch protection, and main CI/CD pipeline - Established CODEOWNERS for critical file reviews - Developed setup script for easy configuration and branch protection setup - Enhanced documentation with CI/CD guide and bypass prevention summary
1 parent 4696f7f commit 817a75a

7 files changed

Lines changed: 1370 additions & 0 deletions

File tree

.github/CODEOWNERS

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Global code owners
2+
* @0xdevcollins
3+
4+
# Critical files that require senior developer review
5+
/.github/ @0xdevcollins
6+
/package.json @0xdevcollins
7+
/tsconfig.json @0xdevcollins
8+
/eslint.config.mjs @0xdevcollins
9+
/.prettierrc @0xdevcollins
10+
11+
# Wallet integration files (critical for security)
12+
/hooks/use-wallet.ts @0xdevcollins
13+
/components/wallet/ @0xdevcollins
14+
/app/api/ @0xdevcollins
15+
16+
# Core components
17+
/components/sheet/ @0xdevcollins
18+
/components/ui/ @0xdevcollins
19+
20+
# Configuration and documentation
21+
/README.md @0xdevcollins
22+
/DEVELOPMENT.md @0xdevcollins
23+
/PRE_COMMIT_SETUP.md @0xdevcollins
24+
25+
# CI/CD workflows
26+
/.github/workflows/ @0xdevcollins
27+
28+
# Type definitions
29+
/types/ @0xdevcollins
30+
31+
# Utility functions
32+
/lib/ @0xdevcollins
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Branch Protection Setup
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
branch:
7+
description: 'Branch to protect'
8+
required: true
9+
default: 'main'
10+
type: choice
11+
options:
12+
- main
13+
- develop
14+
- staging
15+
16+
jobs:
17+
setup-branch-protection:
18+
name: Setup Branch Protection
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Setup Branch Protection Rules
23+
uses: actions/github-script@v7
24+
with:
25+
script: |
26+
const branch = '${{ github.event.inputs.branch }}';
27+
28+
console.log(`Setting up branch protection for: ${branch}`);
29+
30+
try {
31+
await github.rest.repos.updateBranchProtection({
32+
owner: context.repo.owner,
33+
repo: context.repo.repo,
34+
branch: branch,
35+
required_status_checks: {
36+
strict: true,
37+
contexts: [
38+
'Code Quality & Linting',
39+
'Build & Test',
40+
'Security Audit'
41+
]
42+
},
43+
enforce_admins: true,
44+
required_pull_request_reviews: {
45+
required_approving_review_count: 2,
46+
dismiss_stale_reviews: true,
47+
require_code_owner_reviews: true,
48+
require_last_push_approval: true
49+
},
50+
restrictions: {
51+
users: [],
52+
teams: []
53+
},
54+
allow_force_pushes: false,
55+
allow_deletions: false,
56+
block_creations: false,
57+
required_conversation_resolution: true,
58+
lock_branch: false,
59+
allow_fork_syncing: true
60+
});
61+
62+
console.log(`✅ Branch protection rules set for ${branch}`);
63+
} catch (error) {
64+
console.error(`❌ Failed to set branch protection: ${error.message}`);
65+
core.setFailed(error.message);
66+
}

0 commit comments

Comments
 (0)