Skip to content

Commit b431cf7

Browse files
authored
Create issue-metrics.yml
1 parent 5c4dc23 commit b431cf7

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/issue-metrics.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Monthly issue metrics
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '3 2 1 * *'
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
build:
12+
name: issue metrics
13+
runs-on: ubuntu-latest
14+
permissions:
15+
issues: write
16+
pull-requests: read
17+
steps:
18+
- name: Get dates for last month
19+
shell: bash
20+
run: |
21+
# Calculate the first day of the previous month
22+
first_day=$(date -d "last month" +%Y-%m-01)
23+
24+
# Calculate the last day of the previous month
25+
last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d)
26+
27+
#Set an environment variable with the date range
28+
echo "$first_day..$last_day"
29+
echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV"
30+
31+
- name: Run issue-metrics tool
32+
uses: github/issue-metrics@v3
33+
env:
34+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
SEARCH_QUERY: 'repo:zarr-developers/zarr-python is:issue created:${{ env.last_month }} -reason:"not planned"'
36+
37+
- name: Create issue
38+
uses: peter-evans/create-issue-from-file@v5
39+
with:
40+
title: Monthly issue metrics report
41+
token: ${{ secrets.GITHUB_TOKEN }}
42+
content-filepath: ./issue_metrics.md

0 commit comments

Comments
 (0)