Skip to content

Conversation

@markpatterson27
Copy link
Contributor

Adds input option to search for PR based on title.

default: 'desc'
required: false
title:
description: 'Title of the Pull Request to search for.'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: 'Title of the Pull Request to search for.'
description: 'The title of the Pull Request'

res.data.filter(
pr =>
(!author || pr.user.login === author) &&
(!title || pr.title.match(new RegExp(title)))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you need this to be a regular expression? could it be a substring? or do you want to match on the exact title?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regex covers more use cases; pattern matching, partial matching or exact matches should be supported (I haven't tried this). Plain strings can still be used, with the cavat that special characters will have to be escaped. (This is how I'm using it).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, shall we simplify this PR then by only supporting exact matches for now?

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.

2 participants