Skip to content

Conversation

@psavelis
Copy link

#5 - Support Multiple Issues

This pull request refactors the main logic in src/main.ts to improve how Linear issue identifiers are extracted from pull request metadata. The changes allow the script to detect and process multiple Linear issues referenced in the PR branch, title, or body, instead of stopping after the first match. It also ensures outputs are set based on the first detected issue and prevents duplicate processing of issues.

Linear Issue Extraction Improvements:

  • Modified the issue extraction loop to find and process all Linear issue identifiers in the PR metadata (branch, title, body), using matchAll instead of stopping at the first match. This enables support for multiple issues per PR.
  • Added a processedIssueIds set to prevent duplicate processing and labeling of the same issue.

Output and Error Handling Enhancements:

  • Changed output logic to set outputs for the first found issue and its team, rather than returning after the first match.
  • Improved handling of missing PR body by defaulting to an empty string, preventing errors when the body is undefined.

Code Simplification:

  • Simplified the getIdsFromInput function for cleaner input parsing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant