Skip to content

Issue: Timezone Discrepancy in Date Generation for CI/CD Environments #405

Description

@Yashaswini-K-P

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.

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions