Skip to content

close-labeler workflow uses break instead of continue, dropping the QA label on multi-issue PRs #41983

Description

@kobihikri

Summary

.github/workflows/close-labeler.yml uses break where it needs continue, so a PR that closes more than one issue can silently miss getting the QA label.

The loop over the PR's closing issues is:

for (const node of result.repository.pullRequest.closingIssuesReferences.nodes) {
  const shouldQA = node.labels.edges.find(edge => edge.node.name === "Enhancement" || edge.node.name === "Bug") != null
  if (!shouldQA) {
    break        // <-- aborts the whole loop on the first non-Bug/Enhancement issue
  }
  // ... add "QA" label
}

Because it breaks (rather than continues) on the first issue that isn't a Bug/Enhancement, any Bug/Enhancement issues that come after it in the list are never reached, so the QA label isn't added.

Steps to reproduce

A PR whose Closes #… references resolve, in order, to [Documentation, Bug, Enhancement]:

  • current (break): QA label added to none
  • expected (continue): QA label added to the Bug and the Enhancement

I ran the exact loop body in Node to confirm the order-dependent difference.

Expected behavior

Skip the non-qualifying issue and keep checking the rest.

Fix

Change the one word breakcontinue. Happy to open the PR if useful.

AI-assisted; I verified the workflow logic myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions