Repository navigation
Expand file tree
/
Copy pathcaptainhook.json
More file actions
61 lines (61 loc) · 2.17 KB
/
Copy pathcaptainhook.json
File metadata and controls
61 lines (61 loc) · 2.17 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
58
59
60
61
{
"$schema": "https://captainhookphp.github.io/captainhook/schema.json",
"commit-msg": {
"enabled": true,
"actions": [
{
"action": "\\CaptainHook\\App\\Hook\\Message\\Action\\Regex",
"options": {
"regex": "/^(feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert)(\\(.+\\))?!?:\\s[A-Z].{0,99}$/",
"error": "Commit message must follow Conventional Commits with an uppercase subject: <type>(<scope>): Subject"
}
}
]
},
"pre-commit": {
"enabled": true,
"actions": [
{
"action": "echo '🔒 Scanning for secrets...' && if ! command -v gitleaks >/dev/null 2>&1; then echo 'Note: gitleaks not available in this environment; CI still scans on push'; exit 0; fi; gitleaks protect --staged --verbose --redact --config=.gitleaks.toml",
"conditions": []
},
{
"action": "echo 'Running linters...' && composer lint",
"conditions": []
}
]
},
"pre-push": {
"enabled": true,
"actions": [
{
"action": "echo '🔒 Scanning commits for secrets...' && if ! command -v gitleaks >/dev/null 2>&1; then echo 'Note: gitleaks not available in this environment; CI still scans on push'; exit 0; fi; default_ref=$(git symbolic-ref --quiet refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/@@'); gitleaks detect --verbose --redact --config=.gitleaks.toml --log-opts=\"${default_ref:-origin/develop}..HEAD\"",
"conditions": []
},
{
"action": "echo 'Running tests...' && composer test",
"conditions": []
}
]
},
"post-merge": {
"enabled": false,
"actions": []
},
"post-checkout": {
"enabled": false,
"actions": []
},
"post-rewrite": {
"enabled": false,
"actions": []
},
"post-change": {
"enabled": false,
"actions": []
},
"prepare-commit-msg": {
"enabled": false,
"actions": []
}
}