-
-
Notifications
You must be signed in to change notification settings - Fork 144
55 lines (48 loc) · 1.84 KB
/
issue-metrics.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Weekly issue metrics
on:
workflow_dispatch:
permissions:
issues: write
pull-requests: read
jobs:
build:
name: issue metrics
runs-on: ubuntu-latest
steps:
- name: Get dates for last week
shell: bash
run: |
##########################################################
# Create report for the previous week
##########################################################
# Get the current date
current_date=$(date +'%Y-%m-%d')
# Calculate the previous week
previous_date=$(date -d "$current_date -1 week" +'%Y-%m-%d')
echo "$previous_date..$current_date"
echo "prev_week=$previous_date..$current_date" >> "$GITHUB_ENV"
- name: Run issue-metrics tool for issues and PRs opened last week
uses: github/issue-metrics@v3
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEARCH_QUERY: 'mikaelacaron/Basic-Car-Maintenance created:${{ env.prev_week }}'
- name: Create issue for opened issues and PRs last week
uses: peter-evans/create-issue-from-file@v5
with:
title: Weekly issue metrics report for opened issues and PRs
token: ${{ secrets.GITHUB_TOKEN }}
content-filepath: ./issue_metrics.md
assignees: mikaelacaron
labels: weekly-report
- name: Run issue-metrics tool for issues and PRs closed last week
uses: github/issue-metrics@v3
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEARCH_QUERY: 'mikaelacaron/Basic-Car-Maintenance closed:${{ env.prev_week }}'
- name: Create issue for closed issues and prs
uses: peter-evans/create-issue-from-file@v5
with:
title: Monthly issue metrics report for closed issues and prs
content-filepath: ./issue_metrics.md
assignees: mikaelacaron
labels: weekly-report