Skip to content

Commit

Permalink
Merge pull request #153 from spier/add-screenshot-of-output
Browse files Browse the repository at this point in the history
Add screenshot of sample report to the README
  • Loading branch information
zkoppert authored Oct 23, 2023
2 parents 8fd4ca4 + 57ef336 commit 3ade00a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.*|
Expand All @@ -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

Expand Down Expand Up @@ -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

Expand Down
Binary file added docs/img/issue-metrics-sample-output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions docs/search-query.md
Original file line number Diff line number Diff line change
@@ -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:

Expand All @@ -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"`

Expand All @@ -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
Expand Down

0 comments on commit 3ade00a

Please sign in to comment.