Elffuss BraidHub

kikocis/continue public

feat: :technologist: github workflow to measure issue/PR stats
Changesetfda88522a1cf86562496f5f392d24c7ea8c5d1fb194b66b045aeaf4912a34a7f
AuthorNate <sestinj@gmail.com> · 2025-05-10 09:47 -07:00
CommitterNate <sestinj@gmail.com> · 2025-05-10 09:47 -07:00
Parents9e0031d47078

Browse the files at this changeset

1 file changed

added .github/workflows/metrics.yaml +46 −0
@@ -0,0 +1,46 @@
1+name: Monthly issue metrics
2+on:
3+ workflow_dispatch:
4+ schedule:
5+ # Runs every Monday at 9:00 AM PST (17:00 UTC)
6+ - cron: "0 17 * * 1"
7+
8+ push:
9+ branches:
10+ - nate/metrics-action
11+
12+permissions:
13+ contents: read
14+
15+jobs:
16+ build:
17+ name: issue metrics
18+ runs-on: ubuntu-latest
19+ permissions:
20+ issues: write
21+ pull-requests: read
22+ steps:
23+ - name: Get dates for last month
24+ shell: bash
25+ run: |
26+ # Calculate the first day of the previous month
27+ first_day=$(date -d "last month" +%Y-%m-01)
28+
29+ # Calculate the last day of the previous month
30+ last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d)
31+
32+ #Set an environment variable with the date range
33+ echo "$first_day..$last_day"
34+ echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV"
35+
36+ - name: Run issue-metrics tool
37+ uses: github/issue-metrics@v3
38+ env:
39+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+ SEARCH_QUERY: 'repo:continuedev/continue created:${{ env.last_month }} -reason:"not planned"'
41+
42+ - name: Upload metrics report as artifact
43+ uses: actions/upload-artifact@v3
44+ with:
45+ name: issue-metrics-report
46+ path: ./issue_metrics.md