Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/pr-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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!

Expand Down
Loading