diff --git a/README.md b/README.md index 6a69ab2..4c25205 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,11 @@ This is a GitHub Action that searches for issues/pull requests/discussions in a repository, measures several metrics, and generates a report in form of a GitHub issue. The issues/pull requests/discussions to search for can be filtered by using a search query. +This action, developed by GitHub OSPO for our internal use, is open-sourced for your potential benefit. +Feel free to inquire about its usage by creating an issue in this repository. + +## Available Metrics + | Metric | Description | |--------|-------------| |Time to First Response | The duration from creation to the initial comment or review.*| @@ -16,11 +21,15 @@ The issues/pull requests/discussions to search for can be filtered by using a se *For issues and pull requests, comments by issue/pull request author's and comments by bots are excluded. -This action, developed by GitHub OSPO for our internal use, is open-sourced for your potential benefit. -Feel free to inquire about its usage by creating an issue in this repository. +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 [searching discussions](https://docs.github.com/en/search-github/searching-on-github/searching-discussions). -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). +## Sample Report + +The output of this action is a report in form of a GitHub issue. +Below you see a sample of such a GitHub issue. + +![Sample GitHub issue created by the issue/metrics GitHub Action](docs/img/issue-metrics-sample-output.png) ## Getting Started @@ -109,14 +118,14 @@ Below are the allowed configuration options: | `HIDE_LABEL_METRICS` | False | | If set to any value, the time in label metrics will not be displayed in the generated markdown file. | | `IGNORE_USERS` | False | | A comma separated list of users to ignore when calculating metrics. (ie. `IGNORE_USERS: 'user1,user2'`). To ignore bots, append `[bot]` to the user (ie. `IGNORE_USERS: 'github-actions[bot]'`) | -## Links +## Further Documentation +- [Example workflows](./docs/example-workflows.md) +- [Measuring time spent in labels](./docs/measure-time.md) - [Assigning teams instead of individuals](./docs/assign-team-instead-of-individual.md) - [Example using the JSON output instead of the markdown output](./docs/example-using-json-instead-markdown-output.md) -- [Example workflows](./docs/example-workflows.md) +- [Configuring the `SEARCH_QUERY`](./docs/search-query.md) - [Local usage without Docker](./docs/local-usage-without-docker.md) -- [Measuring time spent in labels](./docs/measure-time.md) -- [SEARCH_QUERY](./docs/search-query.md) ## License diff --git a/docs/img/issue-metrics-sample-output.png b/docs/img/issue-metrics-sample-output.png new file mode 100644 index 0000000..ced3a50 Binary files /dev/null and b/docs/img/issue-metrics-sample-output.png differ diff --git a/docs/search-query.md b/docs/search-query.md index 5defd43..13d0329 100644 --- a/docs/search-query.md +++ b/docs/search-query.md @@ -1,7 +1,9 @@ -# SEARCH_QUERY +# Configuring the `SEARCH_QUERY` Issues or Pull Requests? Open or closed? -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). Search results are limited to 1000 results by the GitHub API. 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 [searching discussions](https://docs.github.com/en/search-github/searching-on-github/searching-discussions). Search results are limited to 1000 results by the GitHub API. + +## Examples Issues opened in May 2023: @@ -23,7 +25,7 @@ Discussions opened in May 2023: - `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: +Discussions opened in May 2023 with category of `engineering` and label of `question`: - `repo:owner/repo type:discussions created:2023-05-01..2023-05-31 category:engineering label:"question"` @@ -35,6 +37,8 @@ Both issues and pull requests closed in May 2023 (may have been open in May or e - `repo:owner/repo closed:2023-05-01..2023-05-31` +## Reporting on opened and closed issues/PRs + OK, but what if I want both open or closed issues and pull requests? Due to limitations in issue search (no ability for OR logic), you will need to run the action twice, once for opened and once for closed. Here is an example workflow that does this: ```yaml