We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 993f34d commit a8ad4c5Copy full SHA for a8ad4c5
2 files changed
.github/workflows/collect-metrics.yml
@@ -13,6 +13,8 @@ jobs:
13
contents: write
14
steps:
15
- uses: actions/checkout@v4
16
+ with:
17
+ fetch-depth: 0 # full history needed for git log origin/main (first commit date)
18
- name: Collect metrics
19
env:
20
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tools/metrics/collect.py
@@ -162,7 +162,9 @@ def get_weeks_since_first_commit(repo_root: str) -> list[datetime]:
162
while monday < current_monday:
163
weeks.append(monday)
164
monday += timedelta(weeks=1)
165
- return weeks
+ if weeks:
166
+ return weeks
167
+ # weeks is empty when first commit is in the current week — fall through to fallback
168
# Fallback: last 8 weeks
169
now = datetime.now(tz=timezone.utc)
170
current_monday = iso_week_monday(now)
0 commit comments