Skip to content

Commit fb481ad

Browse files
committed
fix: add missing hasAliasHitForLabel to backfill script context
Each github-script step runs in its own isolated JS context. The backfill step was calling hasAliasHitForLabel (used by the AI alias-evidence gate) but the function was only defined in the triage step, causing a ReferenceError on any issue that triggered AI fallback.
1 parent fa721d4 commit fb481ad

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/labeler.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,20 @@ jobs:
10001000
return {};
10011001
}
10021002
1003+
function hasAliasHitForLabel(text, targetLabel, gameAliasToLabel) {
1004+
const normalizedText = normalizeName(text);
1005+
if (!normalizedText || !targetLabel) return false;
1006+
1007+
const paddedText = ` ${normalizedText} `;
1008+
for (const [alias, label] of gameAliasToLabel.entries()) {
1009+
if (label !== targetLabel) continue;
1010+
if (alias.length < 3) continue;
1011+
if (paddedText.includes(` ${alias} `)) return true;
1012+
}
1013+
1014+
return false;
1015+
}
1016+
10031017
function parseServerlistCsv(csvText) {
10041018
const rows = [];
10051019
const lines = (csvText || '').split(/\r?\n/);

0 commit comments

Comments
 (0)