fix(ci): guard pr.labels access in pr-labeler workflow

Address review feedback from myasnikovdaniil on .github/workflows/pr-labeler.yaml:129:
defensive (pr.labels || []) avoids TypeError if the webhook payload
arrives without the labels field on edge cases like stripped edited
events.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
This commit is contained in:
Aleksei Sviridkin 2026-04-27 13:07:04 +03:00
parent 738762994e
commit 1baadd75a7
No known key found for this signature in database
GPG key ID: 7988329FDF395282

View file

@ -126,7 +126,7 @@ jobs:
const pr = context.payload.pull_request;
const title = pr.title || '';
const body = pr.body || '';
const existing = new Set(pr.labels.map(l => l.name));
const existing = new Set((pr.labels || []).map(l => l.name));
const toAdd = new Set();
// 1. Strip "[Backport release-1.x]" prefix if present.