@@ -60,69 +60,31 @@ jobs:
60
60
HIDE_TIME_TO_ANSWER : " True"
61
61
HIDE_LABEL_METRICS : " True"
62
62
63
- - name : Create issue
64
- uses : peter-evans/create-issue-from-file@v4
65
- with :
66
- title : Monthly New Issues Data ${{ env.last_month }}
67
- token : ${{ secrets.GITHUB_TOKEN }}
68
- content-filepath : ./issue_metrics.md
69
- assignees : spier
70
-
71
- pr-metrics :
72
- name : pull request metrics
73
- runs-on : ubuntu-latest
74
-
75
- steps :
76
-
77
- - name : Get dates for last month
63
+ - name : Change markdown file name to prep for a merge
78
64
shell : bash
79
65
run : |
80
- # Calculate the first day of the previous month
81
- first_day=$(date -d "last month" +%Y-%m-01)
66
+ mv ./issue_metrics.md ready_to_merge_issues_report.md
82
67
83
- # Calculate the last day of the previous month
84
- last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d)
85
-
86
- #Set an environment variable with the date range
87
- echo "$first_day..$last_day"
88
- echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV"
89
-
90
- - name : Check out the code so we can get the CODEOWNERS names
91
- uses : actions/checkout@v4
92
- with :
93
- sparse-checkout : |
94
- .github/CODEOWNERS
95
- sparse-checkout-cone-mode : false
96
-
97
- - name : Get usernames from CODEOWNERS file
98
- shell : bash
99
- run : |
100
- # open a file called CODEOWNERS and load the content into a variable
101
- CODEOWNERS_FILE=$(cat .github/CODEOWNERS)
102
-
103
- # Extract words from CODEOWNERS that start with @ and convert them into a comma-separated string
104
- # ie, "-author:spier -author:zkoppert"
105
- # This will be used to filter out these codeowners from certain stats in later steps
106
- CODEOWNERS_FILTER=$(echo $CODEOWNERS_FILE | grep -o "@[a-zA-Z0-9\-]*" | sed 's/@/-author:/g' | sort | uniq | tr '\n' ' ')
107
-
108
- # Print usernames to terminal for easy debugging
109
- echo "CODEOWNERS_FILTER: $CODEOWNERS_FILTER"
110
-
111
- # Store CODEOWNERS_FILTERto GitHub Action environment (not permanent)
112
- echo "CODEOWNERS_FILTER=$CODEOWNERS_FILTER" >> "$GITHUB_ENV"
113
-
114
- - name : Run issue-metrics tool
68
+ - name : Run issue-metrics tool for PRs
115
69
uses : github/issue-metrics@v2
116
70
env :
117
71
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
118
72
SEARCH_QUERY : ' repo:InnerSourceCommons/InnerSourcePatterns is:pr created:${{ env.last_month }} -reason:"not planned" ${{ env.CODEOWNERS_FILTER }}'
119
73
HIDE_TIME_TO_ANSWER : " True"
120
74
HIDE_LABEL_METRICS : " True"
121
75
76
+ - name : Merge files for report
77
+ shell : bash
78
+ run : |
79
+ echo $'\n\n---\n\n' > hr.md
80
+ cat ready_to_merge_issues_report.md hr.md issue_metrics.md > all.md
81
+
122
82
- name : Create issue
123
83
uses : peter-evans/create-issue-from-file@v4
124
84
with :
125
- title : Monthly New Pull Request Data ${{ env.last_month }}
85
+ title : Monthly Metrics: New Issues + New Pull Requests ${{ env.last_month }}
126
86
token : ${{ secrets.GITHUB_TOKEN }}
127
- content-filepath : ./issue_metrics .md
87
+ content-filepath : ./all .md
128
88
assignees : spier
89
+ labels : |
90
+ community metrics
0 commit comments