You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.filter(({ title })=>!title.startsWith("Merge branch ")&&!title.startsWith("Revert ")),
37
+
);
38
+
}else{
39
+
console.error(
40
+
`Unknown object for first argument "${object}", use 'pr' or 'push'.`,
41
+
);
42
+
process.exit(0);
43
+
}
44
+
45
+
letfailed=false;
46
+
47
+
validate.forEach((payload)=>{
48
+
if(payload.title){
49
+
constmatch=payload.title.match(TITLE_PATTERN);
50
+
if(!match){
51
+
return
52
+
}
53
+
54
+
const{ groups }=match
55
+
56
+
if(groups){
57
+
if(groups.breaking){
58
+
console.error(
59
+
`PRs are not allowed to declare breaking changes at this stage of the project. Please remove the ! in your PR title or commit message and adjust the functionality to be backward compatible.`,
60
+
);
61
+
failed=true;
62
+
}
63
+
64
+
if(
65
+
!ALLOWED_CONVENTIONAL_COMMIT_PREFIXES.find(
66
+
(prefix)=>prefix===groups.prefix,
67
+
)
68
+
){
69
+
console.error(
70
+
`PR (or a commit in it) is using a disallowed conventional commit prefix ("${groups.prefix}"). Only ${ALLOWED_CONVENTIONAL_COMMIT_PREFIXES.join(", ")} are allowed. Make sure the prefix is lowercase!`,
71
+
);
72
+
failed=true;
73
+
}
74
+
75
+
if(groups.package&&groups.prefix!=="chore"){
76
+
console.warn(
77
+
"Avoid using package specifications in PR titles or commits except for the `chore` prefix.",
78
+
);
79
+
}
80
+
}else{
81
+
console.error(
82
+
"PR or commit title must match conventional commit structure.",
83
+
);
84
+
failed=true;
85
+
}
86
+
}
87
+
88
+
if(payload.content){
89
+
if(payload.content.match(RELEASE_AS_DIRECTIVE)){
90
+
console.error(
91
+
"PR descriptions or commit messages must not contain Release-As conventional commit directives.",
"PR descriptions or commit messages must not contain a BREAKING CHANGE conventional commit directive. Please adjust the functionality to be backward compatible.",
0 commit comments