From 1baadd75a72ec75921df438671b5e186aed063e2 Mon Sep 17 00:00:00 2001 From: Aleksei Sviridkin Date: Mon, 27 Apr 2026 13:07:04 +0300 Subject: [PATCH] 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 Signed-off-by: Aleksei Sviridkin --- .github/workflows/pr-labeler.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-labeler.yaml b/.github/workflows/pr-labeler.yaml index d882bc50..ca3023fd 100644 --- a/.github/workflows/pr-labeler.yaml +++ b/.github/workflows/pr-labeler.yaml @@ -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.