File Name
scripts/sync-leaderboard.js
Problem
The getFileName function relies on local system time (new Date()). When the sync script runs inside GitHub Actions runners or cloud containers (which default to UTC), the generated date strings (YYYY-MM-DD) may map to the wrong calendar date depending on the execution time relative to local time zones (e.g., IST). This can lead to misaligned daily snapshots or missing history entries.
Proposed Solution
Explicitly enforce a consistent timezone (such as UTC or the target region's timezone) when generating date strings to ensure reliable behavior across local machines and CI/CD environments.
Implementation Details
- Timezone Standardization: Adjust
getFileName or date helpers to explicitly use UTC methods (getUTCDate(), getUTCFullYear(), etc.) or a timezone formatting library if local alignment is strictly required.
File Name
scripts/sync-leaderboard.jsProblem
The
getFileNamefunction relies on local system time (new Date()). When the sync script runs inside GitHub Actions runners or cloud containers (which default to UTC), the generated date strings (YYYY-MM-DD) may map to the wrong calendar date depending on the execution time relative to local time zones (e.g., IST). This can lead to misaligned daily snapshots or missing history entries.Proposed Solution
Explicitly enforce a consistent timezone (such as UTC or the target region's timezone) when generating date strings to ensure reliable behavior across local machines and CI/CD environments.
Implementation Details
getFileNameor date helpers to explicitly use UTC methods (getUTCDate(),getUTCFullYear(), etc.) or a timezone formatting library if local alignment is strictly required.