From 51bc123ab1bc61506e45e3b1540aefe56c5b5f4d Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Tue, 27 Jun 2023 17:00:11 -0700 Subject: [PATCH 1/2] Update docs for discussions searching --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 76a4157..3591d01 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ to a Markdown file. The issues/pull requests/discussions to search for can be fi This action was developed by the GitHub OSPO for our own use and developed in a way that we could open source it that it might be useful to you as well! If you want to know more about how we use it, reach out in an issue in this repository. -To find syntax for search queries, check out the [documentation](https://docs.github.com/en/issues/tracking-your-work-with-issues/filtering-and-searching-issues-and-pull-requests). +To find syntax for search queries, check out the [documentation on searching issues and pull requests](https://docs.github.com/en/issues/tracking-your-work-with-issues/filtering-and-searching-issues-and-pull-requests) or the [documentation on searching discussions](https://docs.github.com/en/search-github/searching-on-github/searching-discussions). ## Example use cases @@ -125,7 +125,7 @@ jobs: ``` ## SEARCH_QUERY: Issues or Pull Requests? Open or closed? -This action can be configured to run metrics on pull requests and/or issues. It is also configurable by whether they were open or closed in the specified time window. Further query options are listed in [the search documentation](https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests). Here are some search query examples: +This action can be configured to run metrics on discussions, pull requests and/or issues. It is also configurable by whether they were open or closed in the specified time window. Further query options are listed in the [documentation on searching issues and pull requests](https://docs.github.com/en/issues/tracking-your-work-with-issues/filtering-and-searching-issues-and-pull-requests) or the [documentation on searching discussions](https://docs.github.com/en/search-github/searching-on-github/searching-discussions). Here are some search query examples: Issues opened in May 2023: - `repo:owner/repo is:issue created:2023-05-01..2023-05-31` @@ -142,6 +142,9 @@ Pull requests closed in May 2023 (may have been open in May or earlier): Discussions opened in May 2023: - `repo:owner/repo type:discussion created:2023-05-01..2023-05-31` +Discussions opened in May 2023 with category of engineering and label of question: +- `repo:owner/repo type:discussion created:2023-05-01..2023-05-31 category:engineering label:"question"` + Both issues and pull requests opened in May 2023: - `repo:owner/repo created:2023-05-01..2023-05-31` From 025ae4a6a25922aaf1a1150a089faffade70d897 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Tue, 27 Jun 2023 17:01:37 -0700 Subject: [PATCH 2/2] correct type syntax --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3591d01..a163ba2 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Below are the allowed configuration options: | field | required | default | description | |-----------------------|----------|---------|-------------| | `GH_TOKEN` | true | | The GitHub Token used to scan the repository. Must have read access to all repository you are interested in scanning. | -| `SEARCH_QUERY` | true | | The query by which you can filter issues/prs which must contain a `repo:` entry or an `org:` entry. For discussions, include `type:discussion` in the query. | +| `SEARCH_QUERY` | true | | The query by which you can filter issues/prs which must contain a `repo:` entry or an `org:` entry. For discussions, include `type:discussions` in the query. | ### Example workflows @@ -140,10 +140,10 @@ Pull requests closed in May 2023 (may have been open in May or earlier): - `repo:owner/repo is:pr closed:2023-05-01..2023-05-31` Discussions opened in May 2023: -- `repo:owner/repo type:discussion created:2023-05-01..2023-05-31` +- `repo:owner/repo type:discussions created:2023-05-01..2023-05-31` Discussions opened in May 2023 with category of engineering and label of question: -- `repo:owner/repo type:discussion created:2023-05-01..2023-05-31 category:engineering label:"question"` +- `repo:owner/repo type:discussions created:2023-05-01..2023-05-31 category:engineering label:"question"` Both issues and pull requests opened in May 2023: - `repo:owner/repo created:2023-05-01..2023-05-31`