workflows/labels: fix approval label with maintainers

This currently fails with:

```
Method Set.prototype.has called on incompatible receiver undefined
```

Seems like my syntax test previously only hit the case without
maintainers, in which case it doesn't throw :/.
This commit is contained in:
Wolfgang Walther
2025-06-14 18:47:45 +02:00
parent aacfc645dc
commit 4b9fb45060

View File

@@ -113,7 +113,7 @@ jobs:
// And the labels that should be there
const after = JSON.parse(await readFile('comparison/changed-paths.json', 'utf-8')).labels
if (approvals.size > 0) after.push(`12.approvals: ${approvals.size > 2 ? '3+' : approvals.size}`)
if (Array.from(maintainers).some(approvals.has)) after.push('12.approved-by: package-maintainer')
if (Array.from(maintainers).some(m => approvals.has(m))) after.push('12.approved-by: package-maintainer')
// Remove the ones not needed anymore
await Promise.all(