-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path12-codeowners.txt
More file actions
57 lines (43 loc) Β· 1.4 KB
/
12-codeowners.txt
File metadata and controls
57 lines (43 loc) Β· 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
π₯ CODEOWNERS File β Explained + Sample
The CODEOWNERS file defines who must review changes for specific files or directories.
π Location:
.github/CODEOWNERS
(or root: CODEOWNERS)
β
Sample CODEOWNERS File (Production-ready)
# Default owner for everything
* @platform-team
# Backend application code
/app/ @backend-team
# Frontend code
/frontend/ @frontend-team
# Infrastructure & DevOps
/infra/ @devops-team
/terraform/ @devops-team
/k8s/ @devops-team
# CI/CD pipelines
/.github/workflows/ @devops-team
# Security-related files
/security/ @security-team
*.pem @security-team
*.key @security-team
# Documentation
/docs/ @tech-writers
README.md @tech-writers
##########################################
π§ How CODEOWNERS Works
Example scenario:
PR modifies files in /infra/
GitHub automatically:
Requests review from @devops-team
Blocks merge until at least one DevOps member approves
Even if:
β CI passed
β Other reviewers approved
π Code Owner approval is mandatory
π Why CODEOWNERS is important
| Benefit | Why it matters |
| ---------- | ------------------------------- |
| Ownership | Clear responsibility |
| Security | Prevents unauthorized changes |
| Expertise | Right people review the code |
| Governance | Mandatory for infra & prod code |