chore(ci): warn on unmapped type or scope in pr-labeler
Address review feedback from myasnikovdaniil on .github/workflows/pr-labeler.yaml:160,173: emit core.warning when a Conventional Commits type has no kind/* mapping or a scope has no area/* mapping. Without the warning, typos (e.g., "hotfix" instead of "fix") and recurring new scopes silently fall through to area/uncategorized, masking that the mapping has drifted. Assisted-By: Claude <noreply@anthropic.com> Signed-off-by: Aleksei Sviridkin <f@lex.la>
This commit is contained in:
parent
86a1e811cc
commit
79744099f6
1 changed files with 8 additions and 2 deletions
10
.github/workflows/pr-labeler.yaml
vendored
10
.github/workflows/pr-labeler.yaml
vendored
|
|
@ -158,8 +158,12 @@ jobs:
|
|||
}
|
||||
|
||||
// 5. Apply kind/* from type.
|
||||
if (type && typeToKind[type]) {
|
||||
toAdd.add(typeToKind[type]);
|
||||
if (type) {
|
||||
if (typeToKind[type]) {
|
||||
toAdd.add(typeToKind[type]);
|
||||
} else {
|
||||
core.warning(`type "${type}" has no kind/* mapping — typo or new type? See .github/workflows/pr-labeler.yaml typeToKind`);
|
||||
}
|
||||
}
|
||||
|
||||
// 6. Apply area/* from scope. Composite scopes split on comma.
|
||||
|
|
@ -170,6 +174,8 @@ jobs:
|
|||
for (const s of scopes) {
|
||||
if (scopeToArea[s]) {
|
||||
toAdd.add(scopeToArea[s]);
|
||||
} else {
|
||||
core.warning(`scope "${s}" has no area/* mapping — consider extending scopeToArea in .github/workflows/pr-labeler.yaml if it recurs`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue