From b0e6307f24cc450631f84a76f7f7850a4e75ebd6 Mon Sep 17 00:00:00 2001 From: dondetir Date: Wed, 22 Jul 2026 19:07:25 -0500 Subject: [PATCH] fix: fall back to closing keywords in the PR body for non-default-branch PRs --- .github/workflows/pr-standards.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-standards.yml b/.github/workflows/pr-standards.yml index 06838089d354..50738aca43ee 100644 --- a/.github/workflows/pr-standards.yml +++ b/.github/workflows/pr-standards.yml @@ -135,7 +135,14 @@ jobs: const linkedIssues = result.repository.pullRequest.closingIssuesReferences.totalCount; - if (linkedIssues === 0) { + // closingIssuesReferences is only populated for PRs that target the + // default branch, so PRs based on other branches (e.g. v2) would + // always be flagged. Fall back to matching closing keywords in the + // PR body before flagging. + const closingKeyword = /\b(close[sd]?|fix(?:e[sd])?|resolve[sd]?)\b:?\s+#\d+/i; + const bodyReferencesIssue = closingKeyword.test(pr.body ?? ''); + + if (linkedIssues === 0 && !bodyReferencesIssue) { await addLabel('needs:issue'); await comment('issue', `Thanks for your contribution!