Skip to content

Search by title input#41

Open
markpatterson27 wants to merge 2 commits into
juliangruber:masterfrom
markpatterson27:search-title
Open

Search by title input#41
markpatterson27 wants to merge 2 commits into
juliangruber:masterfrom
markpatterson27:search-title

Conversation

@markpatterson27

Copy link
Copy Markdown
Contributor

Adds input option to search for PR based on title.

Comment thread action.yml
default: 'desc'
required: false
title:
description: 'Title of the Pull Request to search for.'

Copy link
Copy Markdown
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'

Comment thread index.js
res.data.filter(
pr =>
(!author || pr.user.login === author) &&
(!title || pr.title.match(new RegExp(title)))

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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