Skip to content

Commit 9db2c7d

Browse files
committed
fix repoactivity.sh start_date calc
1 parent b3dafb8 commit 9db2c7d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/repoactivity.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ repo=${GITHUB_REPO:-perfspect}
2828
for i in {5..0}
2929
do
3030
# Calculate the start date for the month
31-
start_date=$(date -d "$current_date -$i month -$(($(date +%d)-1)) days" +%Y-%m-01)
31+
# First day of the month that is $i months before current_date. Avoid arithmetic on %d (leading 0 -> octal).
32+
start_date=$(date -d "$current_date -$i month" +%Y-%m-01)
3233

3334
# Calculate the end date for the month
3435
end_date=$(date -d "$start_date +1 month -1 day" +%Y-%m-%d)

0 commit comments

Comments
 (0)