Skip to content

Resource-heavy contribution queries fail with RESOURCE_LIMITS_EXCEEDED #163

Description

@qstommyshu

Description

For accounts with enough contribution data, the action's single GraphQL query can exceed GitHub's per-query resource limit. The GraphQL response contains data.user: null plus a RESOURCE_LIMITS_EXCEEDED error, but fetchData dereferences result.user.repositories first, so the action reports a misleading error:

TypeError: Cannot read properties of null (reading 'repositories')
    at Object.fetchData (.../dist/index.js:1160:31)
Image

This reproduces with v0.9.3 on qstommyshu. A public failing run is available at https://github.com/qstommyshu/qstommyshu/actions/runs/29690371983.

GraphQL response

{
  "data": { "user": null },
  "errors": [{
    "type": "RESOURCE_LIMITS_EXCEEDED",
    "path": ["user", "contributionsCollection", "contributionCalendar"],
    "message": "Resource limits for this query exceeded."
  }]
}

The full-year query fails consistently, while the same fields queried one quarter at a time succeed. This is not the hourly GraphQL point limit and reproduces with both a PAT and the workflow's built-in GITHUB_TOKEN.

Expected behavior

The action should still generate the contribution graph when the full-range query exceeds GitHub's per-query resource limit, or at minimum surface the GraphQL error rather than throwing while dereferencing user.

Proposed fix

Keep the existing single-query fast path. Only after the specific resource-limit error:

  1. fetch contributions in quarterly ranges;
  2. fetch repository statistics separately and retain existing pagination;
  3. merge totals, languages, and unique contribution dates;
  4. recalculate contribution levels from the maximum daily count across the full merged range.

I have a tested patch ready and will link the PR here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions