Skip to content

fix: add fetch-depth: 0 to collect-metrics workflow#207

Merged
kiyotis merged 2 commits intomainfrom
fix-metrics-fetch-depth
Mar 13, 2026
Merged

fix: add fetch-depth: 0 to collect-metrics workflow#207
kiyotis merged 2 commits intomainfrom
fix-metrics-fetch-depth

Conversation

@kiyotis
Copy link
Copy Markdown
Contributor

@kiyotis kiyotis commented Mar 13, 2026

Summary

  • get_weeks_since_first_commit() uses git log origin/main to find the first commit date
  • Default actions/checkout@v4 does a shallow clone (fetch-depth: 1), returning only HEAD
  • This made weeks[] empty → IndexError: list index out of range at startup

Fix

Add fetch-depth: 0 to the checkout step so the full history is available.

Related

Fixes failure observed in manual run: https://github.com/nablarch/nabledge-dev/actions/runs/23052021451

kiyotis and others added 2 commits March 13, 2026 22:02
get_weeks_since_first_commit() uses git log origin/main to find the
oldest commit. With the default shallow clone (fetch-depth: 1) it only
sees the HEAD commit, making weeks[] empty and causing IndexError.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When git log returns only the current week's commit (e.g. shallow clone),
weeks[] is built as empty and returned directly, bypassing the fallback.
Now fall through to the 8-week fallback when weeks is empty.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kiyotis kiyotis merged commit a8ad4c5 into main Mar 13, 2026
@kiyotis kiyotis deleted the fix-metrics-fetch-depth branch March 13, 2026 13:05
@kiyotis kiyotis added fix bug Something isn't working and removed fix labels Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant