Skip to content

Commit

Permalink
docs: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Okabe-Junya committed Jul 29, 2023
1 parent af917d1 commit 108c61f
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Below are the allowed configuration options:
| `HIDE_TIME_TO_CLOSE` | False | | If set to any value, the time to close will not be displayed in the generated markdown file. |
| `HIDE_TIME_TO_ANSWER` | False | | If set to any value, the time to answer a discussion will not be displayed in the generated markdown file. |
| `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'`) |

### Example workflows

Expand All @@ -73,7 +74,7 @@ jobs:
build:
name: issue metrics
runs-on: ubuntu-latest

steps:

- name: Get dates for last month
Expand All @@ -84,7 +85,7 @@ jobs:
# Calculate the last day of the previous month
last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d)
#Set an environment variable with the date range
echo "$first_day..$last_day"
echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV"
Expand Down Expand Up @@ -121,7 +122,7 @@ jobs:
build:
name: issue metrics
runs-on: ubuntu-latest

steps:

- name: Run issue-metrics tool
Expand Down Expand Up @@ -168,7 +169,7 @@ Both issues and pull requests opened in May 2023:
Both issues and pull requests closed in May 2023 (may have been open in May or earlier):
- `repo:owner/repo closed:2023-05-01..2023-05-31`

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:
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
name: Monthly issue metrics
Expand All @@ -187,7 +188,7 @@ jobs:
runs-on: ubuntu-latest

steps:

- name: Run issue-metrics tool for issues and prs opened in May 2023
uses: github/issue-metrics@v2
env:
Expand All @@ -201,7 +202,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
content-filepath: ./issue_metrics.md
assignees: <YOUR_GITHUB_HANDLE_HERE>

- name: Run issue-metrics tool for issues and prs closed in May 2023
uses: github/issue-metrics@v2
env:
Expand Down Expand Up @@ -237,7 +238,7 @@ jobs:
build:
name: issue metrics
runs-on: ubuntu-latest
steps:
- name: Run issue-metrics tool
Expand Down Expand Up @@ -377,18 +378,18 @@ jobs:
build:
name: issue metrics
runs-on: ubuntu-latest
steps:
- name: Get dates for last month
shell: bash
run: |
# Calculate the first day of the previous month
first_day=$(date -d "last month" +%Y-%m-01)
# Calculate the last day of the previous month
last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d)
#Set an environment variable with the date range
echo "$first_day..$last_day"
echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV"
Expand All @@ -412,7 +413,7 @@ jobs:
title: Monthly issue metrics report
token: ${{ secrets.GITHUB_TOKEN }}
content-filepath: ./issue_metrics.md
assignees: ${{ env.TEAM_MEMBERS }}
assignees: ${{ env.TEAM_MEMBERS }}
```

## Local usage without Docker
Expand Down

0 comments on commit 108c61f

Please sign in to comment.