File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed
Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change 11name : Monthly issue metrics
22on :
33 workflow_dispatch :
4+ inputs :
5+ start_date :
6+ description : ' Start date (YYYY-MM-DD)'
7+ required : false
8+ type : string
9+ end_date :
10+ description : ' End date (YYYY-MM-DD)'
11+ required : false
12+ type : string
413 schedule :
514 - cron : " 3 2 1 * *"
615
@@ -18,11 +27,17 @@ jobs:
1827 - name : Get dates for last month
1928 shell : bash
2029 run : |
21- # Calculate the first day of the previous month
22- first_day=$(date -d "last month" +%Y-%m-01)
30+ # Use input dates if provided, otherwise calculate the previous month
31+ if [ -n "${{ inputs.start_date }}" ] && [ -n "${{ inputs.end_date }}" ]; then
32+ first_day="${{ inputs.start_date }}"
33+ last_day="${{ inputs.end_date }}"
34+ else
35+ # Calculate the first day of the previous month
36+ first_day=$(date -d "last month" +%Y-%m-01)
2337
24- # Calculate the last day of the previous month
25- last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d)
38+ # Calculate the last day of the previous month
39+ last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d)
40+ fi
2641
2742 #Set an environment variable with the date range
2843 echo "$first_day..$last_day"
You can’t perform that action at this time.
0 commit comments