-
Notifications
You must be signed in to change notification settings - Fork 365
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Retrieve Issues and PRs using a search filter
Currently all open issues for context.repo.owner and context.repo.repo are retrieved using a simple call to client.rest.issues.listForRepo(); If we wanted to add other critera to determine staleness, like only considering PRs with a review state of "changes_requested", we'd have to make additional rest calls to get the reviews for each PR. This is fine but it only solves the issue for review state. Instead, this PR introduces a new action parameter named `only-matching-filter` which takes one or more standard GitHub Issue and Pull Request search strings. So instead of retrieving all open issues and PRs, you can limit the set to operate on by any criteria that GitHub supports. In the process, it opens up the ability to expand the set to include an entire organization or owner instead of just one repo. Example: Retrieve all open PRs for organization "myorg" that are in review state "changes_requested": `only-matching-filter: 'org:myorg is:pr is:open review:changes_requested'` Once that set is retrieved, all the other label, milestone, assignee, date, etc. filters are applied as usual. Although GitHub only allows boolean search critera in a Code search, you an get around that somewhat by specifying multiple search strings separated by ` || `. Example: Retrieve all open PRs for organization "myorg" that are in review state "changes_requested" or that have the label `submitter-action-required` assigned: (split onto two lines for clarity) ``` only-matching-filter: 'org:myorg is:pr is:open review:changes_requested || org:myorg is:pr is:open label:submitter-action-required' ``` Again, once that set is retrieved and duplicates filtered out, all the other label, milestone, assignee, date, etc. filters are applied as usual. If there aren't any `owner`, `org`, `user` or `repo` search terms in the filters, the search is automatically scoped to the context owner and repo. This prevents accidental global searches. `is:open` is also added if not already present. Resolves: #1143
- Loading branch information
Showing
15 changed files
with
246 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.