Skip to content

chore: Make GitHub fetch counts configurable via env vars #160

@O2sa

Description

@O2sa

The numbers used when querying GitHub (repository count, pull request count, issue count, discussion count) are currently hardcoded in lib/github.ts. These should be configurable via runtime environment variables with sensible fallbacks so deployments can tune API usage without code changes.

Suggested env vars and defaults:

  • GITHUB_REPO_COUNT (default: 30)
  • GITHUB_PR_COUNT (default: 80)
  • GITHUB_ISSUE_COUNT (default: 20)
  • GITHUB_DISCUSSION_COUNT (default: 10)

Tasks

  • Update lib/github.ts to read the above env vars at runtime and parse them to integers. Use the listed defaults when values are missing or invalid.
  • Replace the hardcoded numbers in fetchUserDataFromGitHub variables/GraphQL call arguments (repoCount, prCount, issueCount, discussionCount) with the parsed values.
  • Add validation to ensure the values are positive integers and apply reasonable upper bounds to avoid accidental large queries.
  • Document the new env vars in .env.example and README.md (or relevant docs).
  • Add unit tests for the parsing/validation helper (if applicable) to ensure fallbacks and invalid values are handled.

Notes

  • These env vars should be read from the server/runtime environment (not client-side public vars). Keep existing defaults equal to the current hardcoded values to avoid behavior changes.

Tip

🚀 Want to contribute?
Comment assign me to be automatically assigned to this issue via our GitHub Actions bot. Happy coding! ✨

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions